From fdeb37f2cab919dd6723537d07103a34881926d9 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 10:40:08 +1000 Subject: [PATCH 01/33] feat: add f* snippets --- snippets/nushell.json | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index ddc2c7f..21141ed 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -499,6 +499,56 @@ "description": "\"extern\" invocation", "body": "extern ${1:name} [${2:param}: string${3:, }]" }, + "fill builtin": { + "prefix": "fill", + "description": "\"fill\" invocation", + "body": "${1:command} | fill --width ${2:value}" + }, + "filter builtin": { + "prefix": "filter", + "description": "\"filter\" invocation", + "body": "${1:command} | filter {|${2:el}| ${3:predicate} }" + }, + "find builtin": { + "prefix": "find", + "description": "\"find\" invocation", + "body": "${1:command} | find" + }, + "first builtin": { + "prefix": "first", + "description": "\"first\" invocation", + "body": "${1:command} | first ${2:count}" + }, + "flatten builtin": { + "prefix": "flatten", + "description": "\"flatten\" invocation", + "body": "${1:command} | flatten" + }, + "fmt builtin": { + "prefix": "fmt", + "description": "\"fmt\" invocation", + "body": "${1:command} | fmt" + }, + "for builtin": { + "prefix": "for", + "description": "\"for\" invocation", + "body": "for ${1:variable} in ${2:list} { ${3:block} }" + }, + "format builtin": { + "prefix": "format", + "description": "\"format\" invocation", + "body": "${1:command} | format ${2:value}" + }, + "format filesize builtin": { + "prefix": "format-filesize", + "description": "\"format filesize\" invocation", + "body": "${1:command} | format filesize ${2|b,kb,mb,gb,tb,pb,eb,zb,kib,mib,gib,tib,pib,eib,zib|} ${3:column}" + }, + "from builtin": { + "prefix": "from", + "description": "\"from\" invocation", + "body": "${1:command} | from ${2|csv,eml,ics,ini,json,nuon,ods,ssv,toml,tsc,url,vcf,xlsx,xml,yaml,yml|}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 32f8300f05c0dabb5d9dd03394f66b27224a538a Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 10:48:24 +1000 Subject: [PATCH 02/33] feat: add g* snippets --- snippets/nushell.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 21141ed..6c66680 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -549,6 +549,41 @@ "description": "\"from\" invocation", "body": "${1:command} | from ${2|csv,eml,ics,ini,json,nuon,ods,ssv,toml,tsc,url,vcf,xlsx,xml,yaml,yml|}" }, + "g builtin": { + "prefix": "g", + "description": "\"g\" invocation", + "body": "g ${1:shell}" + }, + "get builtin": { + "prefix": "get", + "description": "\"get\" invocation", + "body": "${1:command} | get ${2:path/to/cell}" + }, + "glob builtin": { + "prefix": "glob", + "description": "\"glob\" invocation", + "body": "glob ${1:pattern}" + }, + "grid builtin": { + "prefix": "grid", + "description": "\"grid\" invocation", + "body": "${1:command} | grid" + }, + "group builtin": { + "prefix": "group", + "description": "\"group\" invocation", + "body": "${1:command} | group ${2:count}" + }, + "group-by builtin": { + "prefix": "group-by", + "description": "\"group-by\" invocation", + "body": "${1:command} | group-by ${2:grouper}" + }, + "gstat builtin": { + "prefix": "gstat", + "description": "\"gstat\" invocation", + "body": "gstat ${1:path/to/repository}'" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 3f6d53b2f8c45f448c8e77b61075923ab492f822 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 10:49:59 +1000 Subject: [PATCH 03/33] fix: remove redundant quote --- snippets/nushell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index 6c66680..751545b 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -582,7 +582,7 @@ "gstat builtin": { "prefix": "gstat", "description": "\"gstat\" invocation", - "body": "gstat ${1:path/to/repository}'" + "body": "gstat ${1:path/to/repository}" }, "Custom Command With Switch": { "prefix": "defs", From 0cda060389643bb5b21f722fb39e441478f19fda Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:08:25 +1000 Subject: [PATCH 04/33] feat: permit list all duration suffixes --- snippets/convention.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/convention.md b/snippets/convention.md index c5ae493..95b15e8 100644 --- a/snippets/convention.md +++ b/snippets/convention.md @@ -41,5 +41,5 @@ then example value should be used like `${1:ff}`. Placeholders can not to list all available choices like `${1|big5,euc-jp,euc-kr,gbk,iso-8859-1,utf-16,cp1252,latin5|}`. When there are more then 8 alternatives, provide the most common ones in terms of usage -frequency (it doesn't apply for `date` snippet and placeholders with data -types). +frequency (it doesn't apply for `date` snippet, placeholders with data +types and durations). From 8b9e7a0f94cf9d07698e99f1809b10530daf2e04 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:08:45 +1000 Subject: [PATCH 05/33] feat: snippets for h* commands --- snippets/nushell.json | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 751545b..f0da309 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -584,6 +584,71 @@ "description": "\"gstat\" invocation", "body": "gstat ${1:path/to/repository}" }, + "hash md5 builtin": { + "prefix": "hash-md5", + "description": "\"hash md5\" invocation", + "body": "${1:command} | hash md5" + }, + "hash sha256 builtin": { + "prefix": "hash-sha256", + "description": "\"hash sha256\" invocation", + "body": "${1:command} | hash sha256" + }, + "headers builtin": { + "prefix": "headers", + "description": "\"headers\" invocation", + "body": "${1:command} | headers" + }, + "help builtin": { + "prefix": "help", + "description": "\"help\" invocation", + "body": "help ${1|aliases,commands,externs,modules,operators|}" + }, + "hide builtin": { + "prefix": "hide", + "description": "\"hide\" invocation", + "body": "hide ${1:definitions}" + }, + "hide-env builtin": { + "prefix": "hide-env", + "description": "\"hide-env\" invocation", + "body": "hide-env ${1:variables}" + }, + "histogram builtin": { + "prefix": "histogram", + "description": "\"histogram\" invocation", + "body": "${1:command} | histogram ${2:column} ${3:frequency-column}" + }, + "http delete builtin": { + "prefix": "http-delete", + "description": "\"http delete\" invocation", + "body": "http delete ${1:url}" + }, + "http get builtin": { + "prefix": "http-get", + "description": "\"http get\" invocation", + "body": "http get ${1:url}" + }, + "http head builtin": { + "prefix": "http-head", + "description": "\"http head\" invocation", + "body": "http head ${1:url}" + }, + "http patch builtin": { + "prefix": "http-patch", + "description": "\"http patch\" invocation", + "body": "http patch ${1:url} ${2:data}" + }, + "http post builtin": { + "prefix": "http-post", + "description": "\"http post\" invocation", + "body": "http post ${1:url} ${2:data}" + }, + "http put builtin": { + "prefix": "http-put", + "description": "\"http put\" invocation", + "body": "http put ${1:url} ${2:data}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From edee13e27afb9b42974b55352f57ca98108d9c07 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:13:38 +1000 Subject: [PATCH 06/33] feat: forbid snippet grouping --- snippets/convention.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/convention.md b/snippets/convention.md index 95b15e8..0a596b9 100644 --- a/snippets/convention.md +++ b/snippets/convention.md @@ -43,3 +43,8 @@ Placeholders can not to list all available choices like more then 8 alternatives, provide the most common ones in terms of usage frequency (it doesn't apply for `date` snippet, placeholders with data types and durations). + +## Grouping + +Never group snippets presenting commands with subcommands and sharing the same +set of options. Assume that later they can be extended with different options. From a80fb6ea98aab84fc0b3011d0878205a5fc17bbe Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:27:56 +1000 Subject: [PATCH 07/33] feat: add i* snippets --- snippets/nushell.json | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index f0da309..357e2c1 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -649,6 +649,56 @@ "description": "\"http put\" invocation", "body": "http put ${1:url} ${2:data}" }, + "if builtin": { + "prefix": "if", + "description": "\"if\" invocation", + "body": "if ${1:condition} { ${2:block} }" + }, + "if else builtin": { + "prefix": "if-else", + "description": "\"if\" invocation", + "body": "if ${1:condition} { ${2:block} } else { ${3:block} }" + }, + "if else if else builtin": { + "prefix": "if-else-if-else", + "description": "\"if\" invocation", + "body": "if ${1:condition} { ${2:block} } else if { ${3:block} } else { ${4:block} }" + }, + "ignore builtin": { + "prefix": "ignore", + "description": "\"ignore\" invocation", + "body": "${1:command} | ignore" + }, + "inc builtin": { + "prefix": "inc", + "description": "\"inc\" invocation", + "body": "${1:command} | inc" + }, + "input builtin": { + "prefix": "input", + "description": "\"input\" invocation", + "body": "input ${1:prompt}" + }, + "insert builtin": { + "prefix": "insert", + "description": "\"insert\" invocation", + "body": "${1:command} | insert ${2:column} ${3:value}" + }, + "inspect builtin": { + "prefix": "inspect", + "description": "\"inspect\" invocation", + "body": "${1:command} | inspect" + }, + "into builtin": { + "prefix": "into", + "description": "\"into\" invocation", + "body": "${1:command} | into ${2|binary,bool,datetime,decimal,duration,filesize,int,record,sqlite,string|}" + }, + "is-empty builtin": { + "prefix": "is-empty", + "description": "\"is-empty\" invocation", + "body": "${1:command} | is-empty" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 09e26bfc8ba45b971db0918d0303c34ec916581a Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:32:13 +1000 Subject: [PATCH 08/33] feat: add j* snippets --- snippets/nushell.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 357e2c1..b54ae64 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -699,6 +699,11 @@ "description": "\"is-empty\" invocation", "body": "${1:command} | is-empty" }, + "join builtin": { + "prefix": "join", + "description": "\"join\" invocation", + "body": "${1:command} | join ${2:table} ${3:column}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From d11b69cadf9a1cfd07b8b19dde7e8bbf9eca34fd Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:37:14 +1000 Subject: [PATCH 09/33] feat: add k* snippets --- snippets/nushell.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index b54ae64..cce7f9b 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -704,6 +704,11 @@ "description": "\"join\" invocation", "body": "${1:command} | join ${2:table} ${3:column}" }, + "kill builtin": { + "prefix": "kill", + "description": "\"kill\" invocation", + "body": "kill ${1:pid}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 2c7d3b9c30a5e1735bfcea0462543db369996155 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:39:00 +1000 Subject: [PATCH 10/33] feat: add l* snippets --- snippets/nushell.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index cce7f9b..291b8ee 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -709,6 +709,16 @@ "description": "\"kill\" invocation", "body": "kill ${1:pid}" }, + "loop builtin": { + "prefix": "loop", + "description": "\"loop\" invocation", + "body": "loop { ${1:block} }" + }, + "ls builtin": { + "prefix": "ls", + "description": "\"ls\" invocation", + "body": "ls ${1:pattern}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 9505ba6dc0a6502c1cb7503f8007542a505703d7 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:45:22 +1000 Subject: [PATCH 11/33] feat: permit listing all subcommands in placeholders --- snippets/convention.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/convention.md b/snippets/convention.md index 0a596b9..aa02856 100644 --- a/snippets/convention.md +++ b/snippets/convention.md @@ -41,8 +41,8 @@ then example value should be used like `${1:ff}`. Placeholders can not to list all available choices like `${1|big5,euc-jp,euc-kr,gbk,iso-8859-1,utf-16,cp1252,latin5|}`. When there are more then 8 alternatives, provide the most common ones in terms of usage -frequency (it doesn't apply for `date` snippet, placeholders with data -types and durations). +frequency (it doesn't apply for `date` snippet, data +types, durations and subcommands). ## Grouping From e46811a963290e7c1b2765748696a93626fd2154 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:47:59 +1000 Subject: [PATCH 12/33] feat: force snippet grouping --- snippets/convention.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/snippets/convention.md b/snippets/convention.md index aa02856..97398c3 100644 --- a/snippets/convention.md +++ b/snippets/convention.md @@ -46,5 +46,32 @@ types, durations and subcommands). ## Grouping -Never group snippets presenting commands with subcommands and sharing the same -set of options. Assume that later they can be extended with different options. +Always group snippets presenting different subcommands for the same command and +sharing the same set of options via placeholders with alternatives. Write this: + +```json +{ + "hash builtin": { + "prefix": "hash", + "description": "\"hash\" invocation", + "body": "${1:command} | hash ${2|md5,sha256|}" + } +} +``` + +instead of: + +```json +{ + "hash md5 builtin": { + "prefix": "hash-md5", + "description": "\"hash md5\" invocation", + "body": "${1:command} | hash md5" + }, + "hash sha256 builtin": { + "prefix": "hash-sha256", + "description": "\"hash sha256\" invocation", + "body": "${1:command} | hash sha256" + } +} +``` From af5846889c3e6c1a88d34dce3b82924d8a1cd894 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:49:57 +1000 Subject: [PATCH 13/33] feat: add `lines` snippet --- snippets/nushell.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 291b8ee..b5fa158 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -719,6 +719,11 @@ "description": "\"ls\" invocation", "body": "ls ${1:pattern}" }, + "lines builtin": { + "prefix": "lines", + "description": "\"lines\" invocation", + "body": "${1:command} | lines" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 868241b48204aa9c7812478be255cd98ff3a06ff Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 11:55:33 +1000 Subject: [PATCH 14/33] feat: add remaining l* snippets --- snippets/nushell.json | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index b5fa158..b3f120e 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -709,6 +709,42 @@ "description": "\"kill\" invocation", "body": "kill ${1:pid}" }, + "last builtin": { + "prefix": "last", + "description": "\"last\" invocation", + "body": "${1:command} | last ${2:block}" + }, + "length builtin": { + "prefix": "length", + "description": "\"length\" invocation", + "body": "${1:command} | length" + }, + "let builtin": { + "prefix": "let", + "description": "\"let\" invocation", + "body": "let ${1:name} = ${2:value}" + }, + "@let builtin": { + "prefix": "@let", + "description": "\"let\" invocation", + "body": [ + "# ${1:documentation}", + "let ${2:name} = ${3:value}" + ] + }, + "let-env builtin": { + "prefix": "let-env", + "description": "\"let-env\" invocation", + "body": "let-env ${1:name} = ${2:value}" + }, + "@let-env builtin": { + "prefix": "@let-env", + "description": "\"let-env\" invocation", + "body": [ + "# ${1:documentation}", + "let-env ${2:name} = ${3:value}" + ] + }, "loop builtin": { "prefix": "loop", "description": "\"loop\" invocation", From 6683674bdc1a8aa5ffae1d07624a842406cc6c97 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:16:38 +1000 Subject: [PATCH 15/33] feat: add m* snippets --- snippets/nushell.json | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index b3f120e..28863b9 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -760,6 +760,59 @@ "description": "\"lines\" invocation", "body": "${1:command} | lines" }, + "match builtin": { + "prefix": "match", + "description": "\"match\" invocation", + "body": "match ${1:value} { ${2:pattern} => ${3:value}${4:, }, _ => ${5:value} }" + }, + "math builtin": { + "prefix": "math", + "description": "\"math\" invocation", + "body": "${1:command} | math ${2|abs,arccos,arccosh,arcsin,arcsinh,arctan,arctanh,avg,ceil,cos,cosh,e,eval,exp,floor,ln,log,max,median,min,mode,pi,product,round,sin,sinh,sqrt,stddev,sum,tan,tanh,tau,variance|}" + }, + "merge builtin": { + "prefix": "merge", + "description": "\"merge\" invocation", + "body": "${1:command} | merge ${2:value}" + }, + "metadata builtin": { + "prefix": "metadata", + "description": "\"metadata\" invocation", + "body": "${1:command} | metadata" + }, + "mkdir builtin": { + "prefix": "mkdir", + "description": "\"mkdir\" invocation", + "body": "mkdir ${1:path/to/directory}" + }, + "module builtin": { + "prefix": "module", + "description": "\"module\" invocation", + "body": "module ${1:name} { ${1:block} }" + }, + "move builtin": { + "prefix": "move", + "description": "\"move\" invocation", + "body": "${1:command} | move ${2:column} --${3|before,after|} ${4:column}" + }, + "mut builtin": { + "prefix": "mut", + "description": "\"mut\" invocation", + "body": "mut ${1:name} = ${2:value}" + }, + "@mut builtin": { + "prefix": "@mut", + "description": "\"mut\" invocation", + "body": [ + "# ${1:documentation}", + "mut ${2:name} = ${3:value}" + ] + }, + "mv builtin": { + "prefix": "mv", + "description": "\"mv\" invocation", + "body": "mv ${1:path/to/source} ${2:path/to/destination}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From b17f6785eb37e048ba06b18ef944cf743d932a50 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:19:43 +1000 Subject: [PATCH 16/33] feat: add n* aliases --- snippets/nushell.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 28863b9..3699fcf 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -813,6 +813,16 @@ "description": "\"mv\" invocation", "body": "mv ${1:path/to/source} ${2:path/to/destination}" }, + "nu-check builtin": { + "prefix": "nu-check", + "description": "\"nu-check\" invocation", + "body": "${1:command} | nu-check" + }, + "nu-highlight builtin": { + "prefix": "nu-highlight", + "description": "\"nu-highlight\" invocation", + "body": "${1:command} | nu-highlight" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 154647447ff4aa668e57229b15f03ce4d7c0c6c3 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:27:36 +1000 Subject: [PATCH 17/33] feat: add o* snippets --- snippets/nushell.json | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 3699fcf..1ef518f 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -823,6 +823,39 @@ "description": "\"nu-highlight\" invocation", "body": "${1:command} | nu-highlight" }, + "old-alias builtin": { + "prefix": "old-alias", + "description": "\"old-alias\" invocation", + "body": "old-alias ${1:name} = ${2:value}" + }, + "@old-alias builtin": { + "prefix": "@old-alias", + "description": "\"old-alias\" invocation", + "body": [ + "# ${1:documentation}", + "old-alias ${2:name} = ${3:value}" + ] + }, + "open builtin": { + "prefix": "open", + "description": "\"open\" invocation", + "body": "open ${1:path/to/file}" + }, + "overlay hide builtin": { + "prefix": "overlay-hide", + "description": "\"overlay hide\" invocation", + "body": "overlay hide ${1:name}" + }, + "overlay new builtin": { + "prefix": "overlay-new", + "description": "\"overlay new\" invocation", + "body": "overlay new ${1:name}" + }, + "overlay use builtin": { + "prefix": "overlay-use", + "description": "\"overlay use\" invocation", + "body": "overlay use ${1:name}" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 0a2624f2f8afafe8f60c33a9f1466647b0f870c1 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:42:47 +1000 Subject: [PATCH 18/33] feat: add p* snippets --- snippets/nushell.json | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 1ef518f..8efa606 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -856,6 +856,46 @@ "description": "\"overlay use\" invocation", "body": "overlay use ${1:name}" }, + "par-each builtin": { + "prefix": "par-each", + "description": "\"par-each\" invocation", + "body": "${1:command} | par-each {|${2:el}| ${3:closure} }" + }, + "parse builtin": { + "prefix": "parse", + "description": "\"parse\" invocation", + "body": "${1:command} | parse ${2:pattern}" + }, + "path builtin": { + "prefix": "path", + "description": "\"path\" invocation", + "body": "${1:command} | path ${2|basename,dirname,exists,expand,parse,split,type|}" + }, + "path join builtin": { + "prefix": "path-join", + "description": "\"path-join\" invocation", + "body": "${1:command} | path join ${2:path/to/file}" + }, + "path relative-to builtin": { + "prefix": "path-relative-to", + "description": "\"path-relative-to\" invocation", + "body": "${1:command} | path relative-to ${2:path/to/directory}" + }, + "port builtin": { + "prefix": "port", + "description": "\"port\" invocation", + "body": "port ${1:from} ${2:to}" + }, + "prepend builtin": { + "prefix": "prepend", + "description": "\"prepend\" invocation", + "body": "${1:command} | prepend ${2:row}" + }, + "profile builtin": { + "prefix": "profile", + "description": "\"profile\" invocation", + "body": "profile {|| ${1:closure} }" + }, "Custom Command With Switch": { "prefix": "defs", "body": [ From 97d219200594e6f2ea170092d9f6bbbb22db46e7 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:50:15 +1000 Subject: [PATCH 19/33] feat: clarify when to group snippets --- snippets/convention.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/convention.md b/snippets/convention.md index 97398c3..9046360 100644 --- a/snippets/convention.md +++ b/snippets/convention.md @@ -47,7 +47,8 @@ types, durations and subcommands). ## Grouping Always group snippets presenting different subcommands for the same command and -sharing the same set of options via placeholders with alternatives. Write this: +sharing the same set of options via placeholders with alternatives when there +is no snippet for this command without subcommands. Write this: ```json { From 70dc7375c004a766259b1a7656952c6f778b829f Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:54:42 +1000 Subject: [PATCH 20/33] feat: clean-up snippets --- snippets/nushell.json | 102 +++++++----------------------------------- 1 file changed, 16 insertions(+), 86 deletions(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index 8efa606..519dd16 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -145,86 +145,31 @@ "description": "\"ast\" invocation", "body": "ast ${1:pipeline}" }, - "bits and builtin": { - "prefix": "bits-and", - "description": "\"bits and\" invocation", - "body": "${1:command} | bits and ${2:value}" + "bits builtin": { + "prefix": "bits", + "description": "\"bits\" invocation", + "body": "${1:command} | bits ${2|and,or,rol,ror,shl,shr,xor|} ${3:value}" }, "bits not builtin": { "prefix": "bits-not", "description": "\"bits not\" invocation", "body": "${1:command} | bits not" }, - "bits or builtin": { - "prefix": "bits-or", - "description": "\"bits or\" invocation", - "body": "${1:command} | bits or ${2:value}" - }, - "bits rol builtin": { - "prefix": "bits-rol", - "description": "\"bits rol\" invocation", - "body": "${1:command} | bits rol ${2:value}" - }, - "bits ror builtin": { - "prefix": "bits-ror", - "description": "\"bits ror\" invocation", - "body": "${1:command} | bits ror ${2:value}" - }, - "bits shl builtin": { - "prefix": "bits-shl", - "description": "\"bits shl\" invocation", - "body": "${1:command} | bits shl ${2:value}" - }, - "bits shr builtin": { - "prefix": "bits-shr", - "description": "\"bits shr\" invocation", - "body": "${1:command} | bits shr ${2:value}" - }, - "bits xor builtin": { - "prefix": "bits-xor", - "description": "\"bits xor\" invocation", - "body": "${1:command} | bits xor ${2:value}" - }, - "bytes add builtin": { - "prefix": "bytes-add", - "description": "\"bytes add\" invocation", - "body": "${1:command} | bytes add ${2:value}" + "bytes builtin": { + "prefix": "bytes", + "description": "\"bytes\" invocation", + "body": "${1:command} | bytes ${2|add,collect,ends-with,index-of,remove,starts-with|} ${3:value}" }, "bytes at builtin": { "prefix": "bytes-at", "description": "\"bytes at\" invocation", "body": "${1:command} | bytes at ${2:from}..${3:to}" }, - "bytes collect builtin": { - "prefix": "bytes-collect", - "description": "\"bytes collect\" invocation", - "body": "${1:command} | bytes collect ${2:separator}" - }, - "bytes ends-with builtin": { - "prefix": "bytes-ends-with", - "description": "\"bytes ends-with\" invocation", - "body": "${1:command} | bytes ends-with ${2:pattern}" - }, - "bytes index-of builtin": { - "prefix": "bytes-index-of", - "description": "\"bytes index-of\" invocation", - "body": "${1:command} | bytes index-of ${2:pattern}" - }, - "bytes remove builtin": { - "prefix": "bytes-remove", - "description": "\"bytes remove\" invocation", - "body": "${1:command} | bytes remove ${2:pattern}" - }, "bytes replace builtin": { "prefix": "bytes-replace", "description": "\"bytes replace\" invocation", "body": "${1:command} | bytes replace ${2:search} ${3:replacement}" }, - "bytes starts-with builtin": { - "prefix": "bytes-starts-with", - "description": "\"bytes starts-with\" invocation", - "body": "${1:command} | bytes starts-with ${2:pattern}" - }, "cd builtin": { "prefix": "cd", "description": "\"cd\" invocation", @@ -584,15 +529,10 @@ "description": "\"gstat\" invocation", "body": "gstat ${1:path/to/repository}" }, - "hash md5 builtin": { - "prefix": "hash-md5", - "description": "\"hash md5\" invocation", - "body": "${1:command} | hash md5" - }, - "hash sha256 builtin": { - "prefix": "hash-sha256", - "description": "\"hash sha256\" invocation", - "body": "${1:command} | hash sha256" + "hash builtin": { + "prefix": "hash", + "description": "\"hash\" invocation", + "body": "${1:command} | hash ${2|md5,sha256|}" }, "headers builtin": { "prefix": "headers", @@ -619,20 +559,10 @@ "description": "\"histogram\" invocation", "body": "${1:command} | histogram ${2:column} ${3:frequency-column}" }, - "http delete builtin": { - "prefix": "http-delete", - "description": "\"http delete\" invocation", - "body": "http delete ${1:url}" - }, - "http get builtin": { - "prefix": "http-get", - "description": "\"http get\" invocation", - "body": "http get ${1:url}" - }, - "http head builtin": { - "prefix": "http-head", - "description": "\"http head\" invocation", - "body": "http head ${1:url}" + "http builtin": { + "prefix": "http", + "description": "\"http\" invocation", + "body": "http ${1|delete,get,head|} ${1:url}" }, "http patch builtin": { "prefix": "http-patch", From 1b2d489ff1e54b1291a8d33de59acd15b437f289 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 12:59:49 +1000 Subject: [PATCH 21/33] fix: remove redundant snippet --- snippets/nushell.json | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index 519dd16..4f14c4b 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -825,25 +825,5 @@ "prefix": "profile", "description": "\"profile\" invocation", "body": "profile {|| ${1:closure} }" - }, - "Custom Command With Switch": { - "prefix": "defs", - "body": [ - "# Documentation for ${1:Custom_Command_Name}", - "# Written on ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}", - "def ${1:Custom_Command_Name} [", - "\t--${2:Long_Switch}(-${3:Short_Switch}) # Docs for ${2:Long_Switch}", - "\t] {", - "\t\tlet is_${2:Long_Switch} = $(= \\$${2:Long_Switch} | empty?)\n", - "\t\tif \\$is_${2:Long_Switch} {", - "\t\t\techo \\$true", - "\t\t} {", - "\t\t\techo \\$false", - "\t\t}\n", - "\t# Write some code here", - "\t${4}", - "}" - ], - "description": "Example: Write a custom command with a switch" } } \ No newline at end of file From ed46793b8342f6c3693670d233fedcac6bd7beed Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 13:39:15 +1000 Subject: [PATCH 22/33] feat: add r* snippets --- snippets/nushell.json | 95 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 4f14c4b..3cc9440 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -825,5 +825,100 @@ "prefix": "profile", "description": "\"profile\" invocation", "body": "profile {|| ${1:closure} }" + }, + "query builtin": { + "prefix": "query", + "description": "\"query\" invocation", + "body": "${1:command} | query ${2|db,json,xml|} ${3:expression}" + }, + "query web builtin": { + "prefix": "query-web", + "description": "\"query web\" invocation", + "body": "${1:command} | query web --query ${2:expression}" + }, + "random bool builtin": { + "prefix": "random-bool", + "description": "\"random bool\" invocation", + "body": "random bool --bias ${1:value}" + }, + "random chars builtin": { + "prefix": "random-chars", + "description": "\"random chars\" invocation", + "body": "random chars --length ${1:value}" + }, + "random builtin": { + "prefix": "random", + "description": "\"random\" invocation", + "body": "random ${1|decimal,integer|} ${2:from}..${3:to}" + }, + "random dice builtin": { + "prefix": "random-dice", + "description": "\"random dice\" invocation", + "body": "random dice" + }, + "random uuid builtin": { + "prefix": "random-uuid", + "description": "\"random uuid\" invocation", + "body": "random uuid" + }, + "range builtin": { + "prefix": "range", + "description": "\"range\" invocation", + "body": "${1:command} | range ${2:from}..${3:to}" + }, + "reduce builtin": { + "prefix": "reduce", + "description": "\"reduce\" invocation", + "body": "${1:command} | reduce {|${2:el}, ${3:acc}| ${4:closure} }" + }, + "register builtin": { + "prefix": "register", + "description": "\"register\" invocation", + "body": "register ${1:path/to/plugin}" + }, + "registry query builtin": { + "prefix": "registry-query", + "description": "\"registry query\" invocation", + "body": "registry query ${1:path/to/key} ${2:value}" + }, + "reject builtin": { + "prefix": "reject", + "description": "\"reject\" invocation", + "body": "${1:command} | reject ${2:columns}" + }, + "rename builtin": { + "prefix": "rename", + "description": "\"rename\" invocation", + "body": "${1:command} | rename ${2:columns}" + }, + "return builtin": { + "prefix": "return", + "description": "\"return\" invocation", + "body": "return ${1:value}" + }, + "reverse builtin": { + "prefix": "reverse", + "description": "\"reverse\" invocation", + "body": "${1:command} | reverse" + }, + "rm builtin": { + "prefix": "rm", + "description": "\"rm\" invocation", + "body": "rm ${1:path/to/file}" + }, + "roll builtin": { + "prefix": "roll", + "description": "\"roll\" invocation", + "body": "${1:command} | roll ${2|down,left,right,up|}" + }, + "rotate builtin": { + "prefix": "rotate", + "description": "\"rotate\" invocation", + "body": "${1:command} | rotate" + }, + "run-external builtin": { + "prefix": "run-external", + "description": "\"run-external\" invocation", + "body": "run-external ${1:command}" } } \ No newline at end of file From 25a19b2cb2cacef66d443e725b3fd21f5c21c552 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 13:43:07 +1000 Subject: [PATCH 23/33] feat: use pipe for `open` --- snippets/nushell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index 3cc9440..7aedaba 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -769,7 +769,7 @@ "open builtin": { "prefix": "open", "description": "\"open\" invocation", - "body": "open ${1:path/to/file}" + "body": "${1:path/to/file} | open" }, "overlay hide builtin": { "prefix": "overlay-hide", From 8f6134978c897c40886bf8d830e5e2271a72b51f Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 13:43:34 +1000 Subject: [PATCH 24/33] feat: fix placeholder name for `open` --- snippets/nushell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index 7aedaba..a6f7fd8 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -769,7 +769,7 @@ "open builtin": { "prefix": "open", "description": "\"open\" invocation", - "body": "${1:path/to/file} | open" + "body": "${1:command} | open" }, "overlay hide builtin": { "prefix": "overlay-hide", From fbb2ddc3efd1201b24c14cd0aa283b0842d660a4 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 13:44:25 +1000 Subject: [PATCH 25/33] feat: prefer pipes always --- snippets/convention.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snippets/convention.md b/snippets/convention.md index 9046360..ee0fb0a 100644 --- a/snippets/convention.md +++ b/snippets/convention.md @@ -32,6 +32,8 @@ Snippets are only created for commands those satisfy at least one condition: If there are options available for command or a subcommand then there is no restriction about what options to pick to put in snippet definition. +Always prefer pipes over direct argument passing. + ## Placeholders Placeholders by default should describe what kind of value is expected like From 5b995c0a7a87aa7f731434a40f54ed47233a1846 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 13:49:48 +1000 Subject: [PATCH 26/33] fix: rename filesize snippet --- snippets/nushell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index a6f7fd8..c2394ed 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -38,7 +38,7 @@ "description": "duration", "body": "${1:value}${2|ns,us,ms,sec,min,hr,day,wk|}" }, - "size": { + "filesize": { "prefix": "size", "description": "size", "body": "${1:value}${2|b,kb,mb,gb,tb,pb,eb,zb,kib,mib,gib,tib,pib,eib,zib|}" From 9c5b37037a3c02bcc20af0bce10f3f41e576b1a2 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 13:51:48 +1000 Subject: [PATCH 27/33] feat: fix placeholder for `last` --- snippets/nushell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/nushell.json b/snippets/nushell.json index c2394ed..d4459a5 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -642,7 +642,7 @@ "last builtin": { "prefix": "last", "description": "\"last\" invocation", - "body": "${1:command} | last ${2:block}" + "body": "${1:command} | last ${2:count}" }, "length builtin": { "prefix": "length", From e66820179db59c34853e0dce84fd184bc0a77ecc Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 14:19:13 +1000 Subject: [PATCH 28/33] feat: add s* snippets --- snippets/nushell.json | 145 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index d4459a5..1cc08b4 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -920,5 +920,150 @@ "prefix": "run-external", "description": "\"run-external\" invocation", "body": "run-external ${1:command}" + }, + "save builtin": { + "prefix": "save", + "description": "\"save\" invocation", + "body": "${1:command} | save" + }, + "schema builtin": { + "prefix": "schema", + "description": "\"schema\" invocation", + "body": "${1:command} | schema" + }, + "select builtin": { + "prefix": "select", + "description": "\"select\" invocation", + "body": "${1:command} | select ${2:columns}" + }, + "seq builtin": { + "prefix": "seq", + "description": "\"seq\" invocation", + "body": "seq ${1:from} ${2:to}" + }, + "seq char builtin": { + "prefix": "seq-char", + "description": "\"seq char\" invocation", + "body": "seq char ${1:from} ${2:to}" + }, + "seq date builtin": { + "prefix": "seq-date", + "description": "\"seq date\" invocation", + "body": "seq date --begin-date ${1:from} --end-date ${2:to}" + }, + "shuffle builtin": { + "prefix": "shuffle", + "description": "\"shuffle\" invocation", + "body": "${1:command} | shuffle" + }, + "size builtin": { + "prefix": "size", + "description": "\"size\" invocation", + "body": "${1:command} | size" + }, + "skip builtin": { + "prefix": "skip", + "description": "\"skip\" invocation", + "body": "${1:command} | skip ${2:count}" + }, + "skip until builtin": { + "prefix": "skip-until", + "description": "\"skip until\" invocation", + "body": "${1:command} | skip until {|${2:el}| ${3:predicate} }" + }, + "skip while builtin": { + "prefix": "skip-while", + "description": "\"skip while\" invocation", + "body": "${1:command} | skip while {|${2:el}| ${3:predicate} }" + }, + "sleep builtin": { + "prefix": "sleep", + "description": "\"sleep\" invocation", + "body": "sleep ${1:value}${2|ns,us,ms,sec,min,hr,day,wk|}" + }, + "sort builtin": { + "prefix": "sort", + "description": "\"sort\" invocation", + "body": "${1:command} | sort" + }, + "sort-by builtin": { + "prefix": "sort-by", + "description": "\"sort-by\" invocation", + "body": "${1:command} | sort-by ${2:column}" + }, + "source builtin": { + "prefix": "source", + "description": "\"source\" invocation", + "body": "source ${1:path/to/script}" + }, + "source-env builtin": { + "prefix": "source-env", + "description": "\"source-env\" invocation", + "body": "source-env ${1:path/to/script}" + }, + "split builtin": { + "prefix": "split", + "description": "\"split\" invocation", + "body": "${1:command} | split ${2|chars,words|}" + }, + "split column builtin": { + "prefix": "split-column", + "description": "\"split column\" invocation", + "body": "${1:command} | split column ${2:separator}" + }, + "split list builtin": { + "prefix": "split-list", + "description": "\"split list\" invocation", + "body": "${1:command} | split list ${2:separator}" + }, + "split row builtin": { + "prefix": "split-row", + "description": "\"split row\" invocation", + "body": "${1:command} | split row ${2:separator}" + }, + "split-by builtin": { + "prefix": "split-by", + "description": "\"split-by\" invocation", + "body": "${1:command} | split-by ${2:separator}" + }, + "start builtin": { + "prefix": "start", + "description": "\"start\" invocation", + "body": "start ${1:path/to/file}" + }, + "str builtin": { + "prefix": "str", + "description": "\"str\" invocation", + "body": "${1:command} | str ${2|camel-case,capitalize,downcase,kebab-case,length,pascal-case,reverse,screaming-snake-case,snake-case,title-case,trim,upcase|}" + }, + "str contains builtin": { + "prefix": "str-contains", + "description": "\"str-contains\" invocation", + "body": "${1:command} | str contains ${2:value}" + }, + "str distance builtin": { + "prefix": "str-distance", + "description": "\"str-distance\" invocation", + "body": "${1:command} | str distance ${2:value}" + }, + "str ends-with builtin": { + "prefix": "str-ends-with", + "description": "\"str-ends-with\" invocation", + "body": "${1:command} | str ends-with ${2:value}" + }, + "str index-of builtin": { + "prefix": "str-index-of", + "description": "\"str-index-of\" invocation", + "body": "${1:command} | str index-of ${2:value}" + }, + "str join builtin": { + "prefix": "str-join", + "description": "\"str-join\" invocation", + "body": "${1:command} | str join ${2:value}" + }, + "str replace builtin": { + "prefix": "str-replace", + "description": "\"str-replace\" invocation", + "body": "${1:command} | str replace ${2:search} ${3:replacement}" } } \ No newline at end of file From baba1dcc73967d52bb736d78da7931f424e4a727 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 14:36:45 +1000 Subject: [PATCH 29/33] feat: add t* snippets --- snippets/nushell.json | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 1cc08b4..1b38634 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -1065,5 +1065,60 @@ "prefix": "str-replace", "description": "\"str-replace\" invocation", "body": "${1:command} | str replace ${2:search} ${3:replacement}" + }, + "table builtin": { + "prefix": "table", + "description": "\"table\" invocation", + "body": "${1:command} | table" + }, + "take builtin": { + "prefix": "take", + "description": "\"take\" invocation", + "body": "${1:command} | table ${2:count}" + }, + "take until builtin": { + "prefix": "take-until", + "description": "\"take until\" invocation", + "body": "${1:command} | take until {|${2:el}| ${3:predicate} }" + }, + "take while builtin": { + "prefix": "take-while", + "description": "\"take while\" invocation", + "body": "${1:command} | take while {|${2:el}| ${3:predicate} }" + }, + "timeit builtin": { + "prefix": "timeit", + "description": "\"timeit\" invocation", + "body": "timeit { ${1:block} }" + }, + "to builtin": { + "prefix": "to", + "description": "\"to\" invocation", + "body": "${1:command} | to ${2|csv,html,json,md,nuon,text,toml,tsv,xml,yaml|}" + }, + "touch builtin": { + "prefix": "touch", + "description": "\"touch\" invocation", + "body": "touch ${1:path/to/file}" + }, + "transpose builtin": { + "prefix": "transpose", + "description": "\"transpose\" invocation", + "body": "${1:command} | transpose" + }, + "try builtin": { + "prefix": "try", + "description": "\"try\" invocation", + "body": "try { ${1:block} }" + }, + "try catch builtin": { + "prefix": "try-catch", + "description": "\"try catch\" invocation", + "body": "try { ${1:block} } catch { ${2:block} }" + }, + "tutor builtin": { + "prefix": "tutor", + "description": "\"tutor\" invocation", + "body": "tutor ${1:search}" } } \ No newline at end of file From 7a0c4c8912853718026cd6a6efb7574a29cfd8d5 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 15:32:29 +1000 Subject: [PATCH 30/33] feat: add u* snippets --- snippets/nushell.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 1b38634..2876ce4 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -1120,5 +1120,40 @@ "prefix": "tutor", "description": "\"tutor\" invocation", "body": "tutor ${1:search}" + }, + "uniq builtin": { + "prefix": "uniq", + "description": "\"uniq\" invocation", + "body": "${1:command} | uniq" + }, + "uniq-by builtin": { + "prefix": "uniq-by", + "description": "\"uniq-by\" invocation", + "body": "${1:command} | uniq-by ${2:columns}" + }, + "update builtin": { + "prefix": "update", + "description": "\"update\" invocation", + "body": "${1:command} | update ${2:column} ${3:value}" + }, + "update cells builtin": { + "prefix": "update-cells", + "description": "\"update cells\" invocation", + "body": "${1:command} | update cells {|${2:el}| ${3:closure} }" + }, + "upsert builtin": { + "prefix": "upsert", + "description": "\"upsert\" invocation", + "body": "${1:command} | upsert ${2:column} ${3:value}" + }, + "url builtin": { + "prefix": "url", + "description": "\"url\" invocation", + "body": "${1:command} | url ${2|build-query,encode,join,parse|}" + }, + "use builtin": { + "prefix": "use", + "description": "\"use\" invocation", + "body": "use ${2:module} ${3:members}" } } \ No newline at end of file From c7000d33ad1f0cfabbe01866c7c438711fafb1ec Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 15:36:46 +1000 Subject: [PATCH 31/33] feat: add v* snippets --- snippets/nushell.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 2876ce4..0d2b6c7 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -1155,5 +1155,20 @@ "prefix": "use", "description": "\"use\" invocation", "body": "use ${2:module} ${3:members}" + }, + "values builtin": { + "prefix": "values", + "description": "\"values\" invocation", + "body": "${1:command} | values" + }, + "view source builtin": { + "prefix": "view-source", + "description": "\"view source\" invocation", + "body": "view source ${1:value}" + }, + "view span builtin": { + "prefix": "view-span", + "description": "\"view span\" invocation", + "body": "view span ${1:from} ${2:to}" } } \ No newline at end of file From 74f8636b0ac118aafddf40f08f1a52f2e99e6a6f Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 15:41:56 +1000 Subject: [PATCH 32/33] feat: add w* snippets --- snippets/nushell.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index 0d2b6c7..a53f293 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -1170,5 +1170,40 @@ "prefix": "view-span", "description": "\"view span\" invocation", "body": "view span ${1:from} ${2:to}" + }, + "watch builtin": { + "prefix": "watch", + "description": "\"watch\" invocation", + "body": "watch ${1:path/to/directory} {|${2:op}, ${3:path}, ${4:new_path}| ${5:block} }" + }, + "where builtin": { + "prefix": "where", + "description": "\"where\" invocation", + "body": "${1:command} | where ${2:condition}" + }, + "which builtin": { + "prefix": "which", + "description": "\"which\" invocation", + "body": "which ${1:command}" + }, + "while builtin": { + "prefix": "while", + "description": "\"while\" invocation", + "body": "while ${1:condition} { ${2:block} }" + }, + "window builtin": { + "prefix": "window", + "description": "\"window\" invocation", + "body": "${1:command} | window ${1:count}" + }, + "with-env builtin": { + "prefix": "with-env", + "description": "\"with-env\" invocation", + "body": "with-env ${1:variables} { ${2:block} }" + }, + "wrap builtin": { + "prefix": "wrap", + "description": "\"wrap\" invocation", + "body": "${1:command} | wrap ${2:column}" } } \ No newline at end of file From b27e76438e29e098cc040f6fdf281cb29abdb0b7 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 30 Apr 2023 15:42:32 +1000 Subject: [PATCH 33/33] feat: add z* snippets --- snippets/nushell.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snippets/nushell.json b/snippets/nushell.json index a53f293..6cc4cb2 100644 --- a/snippets/nushell.json +++ b/snippets/nushell.json @@ -1205,5 +1205,10 @@ "prefix": "wrap", "description": "\"wrap\" invocation", "body": "${1:command} | wrap ${2:column}" + }, + "zip builtin": { + "prefix": "zip", + "description": "\"zip\" invocation", + "body": "${1:command} | zip ${2:list}" } } \ No newline at end of file