neosnippet.vim/autoload/neosnippet/snippets/sh.snip

90 lines
1.2 KiB
Plaintext
Raw Normal View History

2012-02-02 04:33:35 +00:00
snippet if
2012-10-30 08:53:14 +00:00
if [ ${1:#:condition} ]; then
${0:TARGET}
2012-02-02 04:33:35 +00:00
fi
snippet el
else
2012-10-30 08:53:14 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
snippet elif
2012-10-30 08:53:14 +00:00
elif [ ${1:#:condition} ]; then
${0:TARGET}
2012-02-02 04:33:35 +00:00
snippet for
2012-10-30 08:53:14 +00:00
for ${1:i} in ${2:#:words}; do
${0:TARGET}
2012-02-02 04:33:35 +00:00
done
2013-02-16 04:13:32 +00:00
snippet while
alias wh
2012-10-30 08:53:14 +00:00
while ${1:#:condition} ; do
${0:TARGET}
2012-02-02 04:33:35 +00:00
done
snippet until
2012-10-30 08:53:14 +00:00
until ${1:#:condition} ; do
${0:TARGET}
2012-02-02 04:33:35 +00:00
done
2012-10-30 08:53:14 +00:00
snippet here
alias h
2012-02-02 04:33:35 +00:00
<<${1}
2012-10-30 08:53:14 +00:00
${0:TARGET}
2012-02-02 04:33:35 +00:00
snippet env
#!/usr/bin/env ${1}
snippet tmp
${1:TMPFILE}="mktemp -t ${2:untitled}"
trap "rm -f '$${1}'" 0 # EXIT
trap "rm -f '$${1}'; exit 1" 2 # INT
trap "rm -f '$${1}'; exit 1" 1 15 # HUP TERM
2012-10-30 08:53:14 +00:00
${0}
2013-02-16 04:13:32 +00:00
snippet function
alias func
${1:#:name}()
{
${0:TARGET}
}
2013-06-26 03:43:18 +00:00
snippet match-regexp
abbr =~
options head
if [[ $${1:string} =~ ${2:^regexp.*} ]]; then
${0}
fi
snippet assign
abbr var-assign
options head
${1:name}="${2:something}"
snippet case
options head
case "$${1:{name}}" in
${2:pattern*})
${0}
;;
*)
${3:echo "$$1\} Didn't match anything"}
esac
snippet warn
options head
echo "${0:TARGET}" 1>&2
snippet abort
options head
echo "${0:TARGET}" 1>&2
exit 1
2013-02-16 04:13:32 +00:00
2013-06-26 03:43:18 +00:00
# vim: set noexpandtab :