snippet if "If statement" iw if [[ ${1:} ]]; then ${2:} fi endsnippet snippet while_shift "A dependency-less option parser" iw while [[ $# -gt 0 ]]; then do case $1 in -h|--help) echo "$help_section" exit 0 ;; $2 esac done endsnippet snippet if "If conditional" iw if ${1:}; then ${2:} fi endsnippet snippet while "While loop" iw while ${1:}; do ${2:} done endsnippet snippet select "Select loop stuff" iw select ${1:} in ${2:foo bar baz} do ${3:# Your stuff here} done $0 endsnippet snippet getopts "An argument parser with getopts" iw while getopts ${1:} ${2:arg} do case ${2:"h"} in h) echo $_help exit 0 *) echo $_help exit 0 esca done endsnippet