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

66 lines
784 B
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
snippet case
2012-10-30 08:53:14 +00:00
case ${1:#:word} in
${2:#:pattern} )
2012-02-02 04:33:35 +00:00
${0}
2012-10-30 08:53:14 +00:00
;;
2012-02-02 04:33:35 +00:00
esac
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}
}