aboutsummaryrefslogtreecommitdiff
path: root/files/.vim
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2023-09-02 00:50:45 +0500
committerAnton Bobov <anton@bobov.name>2023-09-03 20:19:46 +0500
commit677a301e260aa2a170483b7b79ea35f1042f47c5 (patch)
treee0aaf7f96d347270deeb930e7858418ad7363fc3 /files/.vim
parentf2489385f752b85e786565b8fa751b1838904324 (diff)
[vim] Added .sh snippet
Diffstat (limited to 'files/.vim')
-rw-r--r--files/.vim/UltiSnips/sh.snippets14
1 files changed, 14 insertions, 0 deletions
diff --git a/files/.vim/UltiSnips/sh.snippets b/files/.vim/UltiSnips/sh.snippets
index e509201..4fc51e9 100644
--- a/files/.vim/UltiSnips/sh.snippets
+++ b/files/.vim/UltiSnips/sh.snippets
@@ -5,3 +5,17 @@ endsnippet
snippet scriptdir "get script directory"
scriptdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
endsnippet
+
+snippet getopts
+while getopts ":h" opt; do
+ case "${opt}" in
+ h)
+ help
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+endsnippet