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' +``` + + 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 :