From 0d80161e721aefebcc0d14b83912de56764c8d3a Mon Sep 17 00:00:00 2001 From: remche Date: Tue, 29 Oct 2024 14:37:49 +0100 Subject: [PATCH 1/3] add fish snippets from bmalehorn/vscode-fish --- README.md | 1 + package.json | 4 + snippets/fish.json | 190 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 195 insertions(+) create mode 100644 snippets/fish.json diff --git a/README.md b/README.md index 40c2ef4e..b4245a65 100644 --- a/README.md +++ b/README.md @@ -131,4 +131,5 @@ A good portion of the snippets have been forked from the following repositories: - [vscode-react-javascript-snippets](https://github.com/dsznajder/vscode-react-javascript-snippets) - [honza/vim-snippets - Verilog](https://github.com/honza/vim-snippets/blob/master/snippets/verilog.snippets) - [vscode-relm4-snippets](https://github.com/Relm4/vscode-relm4-snippets) +- bmalehorn/vscode-fish/ - And more... diff --git a/package.json b/package.json index 1c6c7167..eb34b52d 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,10 @@ "language": ["eelixir", "heex"], "path": "./snippets/eelixir.json" }, + { + "language": "fish", + "path": "./snippets/fish.json" + }, { "language": "fortran", "path": "./snippets/fortran.json" diff --git a/snippets/fish.json b/snippets/fish.json new file mode 100644 index 00000000..db819f99 --- /dev/null +++ b/snippets/fish.json @@ -0,0 +1,190 @@ +{ + "shebang": { + "prefix": "shebang", + "description": "shebang", + "body": "#!/usr/bin/env fish" + }, + "if operator": { + "prefix": "if", + "description": "if operator", + "body": [ + "if ${1:condition}", + "\t$0", + "end" + ] + }, + "if else operator": { + "prefix": "if-else", + "description": "if operator", + "body": [ + "if ${1:condition}", + "\t${2:echo}", + "else", + "\t$0", + "end" + ] + }, + "else operator": { + "prefix": "else", + "description": "else operator", + "body": [ + "else", + "\t$0" + ] + }, + "if compare with comparison operator": { + "prefix": "if-compare", + "description": "if operator", + "body": [ + "if test ${1:first} ${2|=,!=,-eq,-ne,-gt,-ge,-lt,-le,-nt,-ot,-ef|} ${3:second}", + "\t$0", + "end" + ] + }, + "if else with comparison operator": { + "prefix": "if-compare-else", + "description": "if else operator", + "body": [ + "if test ${1:first} ${2|=,!=,-eq,-ne,-gt,-ge,-lt,-le,-nt,-ot,-ef|} ${3:second}", + "\t${4:echo}", + "else", + "\t$0", + "end" + ] + }, + "while operator": { + "prefix": "while", + "description": "while operator", + "body": [ + "while ${1:condition}", + "\t$0", + "end" + ] + }, + "while with comparison operator": { + "prefix": "while-compare", + "description": "while operator", + "body": [ + "while test ${1:first} ${2|=,!=,-eq,-ne,-gt,-ge,-lt,-le,-nt,-ot,-ef|} ${3:second}", + "\t$0", + "end" + ] + }, + "for operator": { + "prefix": "for", + "description": "for operator", + "body": [ + "for ${1:item} in ${2:collection}", + "\t$0", + "end" + ] + }, + "switch operator": { + "prefix": "switch", + "description": "switch operator", + "body": [ + "switch ${1:variable}", + "\tcase ${2:glob}", + "\t\t${3:echo}", + "\tcase \"*\"", + "\t\t$0", + "end" + ] + }, + "case operator": { + "prefix": "case", + "description": "case operator", + "body": [ + "case ${1:glob}", + "\t$0" + ] + }, + "function definition": { + "prefix": "function", + "description": "function definition", + "body": [ + "function ${1:name}", + "\t$0", + "end" + ] + }, + "function with arguments definition": { + "prefix": "function-arguments", + "description": "function definition", + "body": [ + "function ${1:name} ${2|--arguments,-a|} ${3:arguments}", + "\t$0", + "end" + ] + }, + "function with documentation definition": { + "prefix": "function-description", + "description": "function description", + "body": [ + "function ${1:name} ${2|--description,-d|} ${3:description}", + "\t$0", + "end" + ] + }, + "begin end block": { + "prefix": "begin", + "description": "begin end block", + "body": [ + "begin", + "\t$0", + "end" + ] + }, + "and operator": { + "prefix": "and", + "description": "and operator", + "body": "${1:command}; and ${2:command}" + }, + "or operator": { + "prefix": "or", + "description": "or operator", + "body": "${1:command}; or ${2:command}" + }, + "set_color builtin": { + "prefix": "set-color", + "description": "\"set-color\" invocation", + "body": "set_color ${1|black,red,green,yellow,blue,magenta,cyan,white,brblack,brred,brgreen,bryellow,brblue,brmagenta,brcyan,brwhite|}" + }, + "set_color with font style builtin": { + "prefix": "set-color-style", + "description": "\"set-color\" invocation", + "body": "set_color ${1|--bold,-o,--dim,-d,--italics,-i,--reverse,-r,--underline,-u|}" + }, + "set builtin": { + "prefix": "set", + "description": "\"set\" invocation", + "body": "set ${1|--universal,-U,--function,-f,--local,-l,--global,-g,--export,-x,--unexport,-u,--path,--unpath,--append,-a,--prepend,-p,--erase,-e,--query,-q,--names,-n,--show,-S,--long,-L|} ${2:variable} ${3:value}" + }, + "string builtin": { + "prefix": "string", + "description": "\"string\" invocation", + "body": "string ${1|collect,escape,join,join0,length,lower,match,pad,repeat,replace,shorten,split,split0,sub,trim,unescape,upper|} ${2:variable}" + }, + "argparse builtin": { + "prefix": "argparse", + "description": "\"argparse\" invocation", + "body": "argparse ${1:specification} -- ${2:variable}" + }, + "test builtin": { + "prefix": "test", + "description": "\"test\" invocation", + "body": "test ${1:first} ${2|=,!=,-eq,-ne,-gt,-ge,-lt,-le,-nt,-ot,-ef|} ${3:second}" + }, + "random builtin": { + "prefix": "random", + "description": "\"random\" invocation", + "body": "random ${1:minimum} ${2:maximum}" + }, + "comment": { + "prefix": "comment", + "description": "comment", + "body": "# ${1}" + } +} + + From d187060e574003e498169edab15968f6558ccf13 Mon Sep 17 00:00:00 2001 From: remche Date: Wed, 18 Dec 2024 13:54:43 +0100 Subject: [PATCH 2/3] fix link to bmalehorn/vscode-fish repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4245a65..71888566 100644 --- a/README.md +++ b/README.md @@ -131,5 +131,5 @@ A good portion of the snippets have been forked from the following repositories: - [vscode-react-javascript-snippets](https://github.com/dsznajder/vscode-react-javascript-snippets) - [honza/vim-snippets - Verilog](https://github.com/honza/vim-snippets/blob/master/snippets/verilog.snippets) - [vscode-relm4-snippets](https://github.com/Relm4/vscode-relm4-snippets) -- bmalehorn/vscode-fish/ +- [bmalehorn/vscode-fish/](https://github.com/bmalehorn/vscode-fish/) - And more... From 15df4eda2ae9b35ab26a4d564452cb40c604e194 Mon Sep 17 00:00:00 2001 From: remche Date: Wed, 18 Dec 2024 14:02:24 +0100 Subject: [PATCH 3/3] remove single word snippets --- snippets/fish.json | 53 ---------------------------------------------- 1 file changed, 53 deletions(-) diff --git a/snippets/fish.json b/snippets/fish.json index db819f99..08e8b1ed 100644 --- a/snippets/fish.json +++ b/snippets/fish.json @@ -134,57 +134,4 @@ "\t$0", "end" ] - }, - "and operator": { - "prefix": "and", - "description": "and operator", - "body": "${1:command}; and ${2:command}" - }, - "or operator": { - "prefix": "or", - "description": "or operator", - "body": "${1:command}; or ${2:command}" - }, - "set_color builtin": { - "prefix": "set-color", - "description": "\"set-color\" invocation", - "body": "set_color ${1|black,red,green,yellow,blue,magenta,cyan,white,brblack,brred,brgreen,bryellow,brblue,brmagenta,brcyan,brwhite|}" - }, - "set_color with font style builtin": { - "prefix": "set-color-style", - "description": "\"set-color\" invocation", - "body": "set_color ${1|--bold,-o,--dim,-d,--italics,-i,--reverse,-r,--underline,-u|}" - }, - "set builtin": { - "prefix": "set", - "description": "\"set\" invocation", - "body": "set ${1|--universal,-U,--function,-f,--local,-l,--global,-g,--export,-x,--unexport,-u,--path,--unpath,--append,-a,--prepend,-p,--erase,-e,--query,-q,--names,-n,--show,-S,--long,-L|} ${2:variable} ${3:value}" - }, - "string builtin": { - "prefix": "string", - "description": "\"string\" invocation", - "body": "string ${1|collect,escape,join,join0,length,lower,match,pad,repeat,replace,shorten,split,split0,sub,trim,unescape,upper|} ${2:variable}" - }, - "argparse builtin": { - "prefix": "argparse", - "description": "\"argparse\" invocation", - "body": "argparse ${1:specification} -- ${2:variable}" - }, - "test builtin": { - "prefix": "test", - "description": "\"test\" invocation", - "body": "test ${1:first} ${2|=,!=,-eq,-ne,-gt,-ge,-lt,-le,-nt,-ot,-ef|} ${3:second}" - }, - "random builtin": { - "prefix": "random", - "description": "\"random\" invocation", - "body": "random ${1:minimum} ${2:maximum}" - }, - "comment": { - "prefix": "comment", - "description": "comment", - "body": "# ${1}" } -} - -