From 2e4a10574288e9bc31555568f96dfb71ed701707 Mon Sep 17 00:00:00 2001 From: Andrew Matthews Date: Wed, 9 Jan 2019 12:52:27 +1100 Subject: [PATCH 1/2] added basic fish shell snippets --- neosnippets/fish.snip | 80 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 neosnippets/fish.snip diff --git a/neosnippets/fish.snip b/neosnippets/fish.snip new file mode 100644 index 00000000..bc7f10bd --- /dev/null +++ b/neosnippets/fish.snip @@ -0,0 +1,80 @@ +snippet #! +abbr #!/usr/bin/env fish +alias shebang +options head + #!/usr/bin/env fish + ${0} + + +snippet if + if ${1:#:condition} ] + ${0:TARGET} + end + + +snippet el + else + ${0:TARGET} + + +snippet elif + elseif ${1:#:condition} + ${0:TARGET} + + +snippet for + for ${1:i} in ${2:#:words} + ${0:TARGET} + end + +snippet while +alias wh + while ${1:#:condition} + ${0:TARGET} + end + + +snippet heredoc +alias h << + << ${1:EOF} + ${0:#:TARGET} + $1 + +snippet fn +alias func + function ${1:#:name} -a ${2:#:arg} ${4:--on-event some-event} ${3:-d "explanation"} + ${0:TARGET} + end + +snippet match-regexp +abbr =~ +options head + if [[ $${1:string} =~ ${2:^regexp.*} ]]; then + ${0} + fi + +snippet assign +abbr var-assign +options head + set -l ${1:name} ${2:something} + +snippet switch +options head + switch ${1:name} + case ${2:pattern*} + ${0} + # Note that the next case has a wildcard which is quoted + case '*' + echo default behaviour here + end + +snippet warn +options head + echo "${0:TARGET}" 1>&2 + +snippet abort +options head + echo "${0:TARGET}" 1>&2 + exit 1 + +# vim: set noexpandtab : From 737f860f7a63914f0920a913a2f1b89d7c1726e9 Mon Sep 17 00:00:00 2001 From: Andrew Matthews Date: Wed, 9 Jan 2019 12:56:00 +1100 Subject: [PATCH 2/2] instructions for SpaceVim --- README.mkd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.mkd b/README.mkd index 1c329a53..f4ad7c83 100644 --- a/README.mkd +++ b/README.mkd @@ -6,3 +6,13 @@ The standard snippets repository for You can fork or send pull request. +## Using from SpaceVim + +Add the following to `~/.SpaceVim/init.vim`: + +```vim +let g:neosnippet#enable_snipmate_compatibility = 1 +let g:neosnippet#snippets_directory='~/opt/neosnippet-snippets/neosnippets' +``` + +