aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-08-01 23:10:57 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-08-01 23:10:57 +0200
commit81b6ccff547b93d3e4cd007e7715feb2185ab8f7 (patch)
tree81f4e7253557bef1fbaefec27a0db34627743241
parentf88b8b71ca42c113c0210c07a542ab9b1bfd6d5d (diff)
downloadconfigs-81b6ccff547b93d3e4cd007e7715feb2185ab8f7.tar.gz
configs-81b6ccff547b93d3e4cd007e7715feb2185ab8f7.zip
Updated vim templates for sh.
-rw-r--r--stow/vim/.vim/ftplugin/sh/sh.vim4
-rw-r--r--stow/vim/.vim/ftplugin/sh/snippets/case.txt11
-rw-r--r--stow/vim/.vim/ftplugin/sh/snippets/template.txt11
3 files changed, 20 insertions, 6 deletions
diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim
index d81ab3c..2aec1f2 100644
--- a/stow/vim/.vim/ftplugin/sh/sh.vim
+++ b/stow/vim/.vim/ftplugin/sh/sh.vim
@@ -19,5 +19,5 @@ nnoremap <buffer> <leader>e :Errors<CR>
let mapleader = ","
-inoremap <buffer> <leader>if if <+++>; then<CR><++><CR>fi<++><Esc>?<+++><CR>cf>
-"inoremap <buffer> <leader>if <Esc>:read ~/.vim/ftplugin/sh/snippets/if.txt<CR>kdd/<+++><CR>cf>
+inoremap <buffer> <leader>if <Esc>:read ~/.vim/ftplugin/sh/snippets/if.txt<CR>kdd/<+++><CR>cf>
+inoremap <buffer> <leader>case <Esc>:read ~/.vim/ftplugin/sh/snippets/case.txt<CR>kdd/<+++><CR>cf>
diff --git a/stow/vim/.vim/ftplugin/sh/snippets/case.txt b/stow/vim/.vim/ftplugin/sh/snippets/case.txt
new file mode 100644
index 0000000..4e203fa
--- /dev/null
+++ b/stow/vim/.vim/ftplugin/sh/snippets/case.txt
@@ -0,0 +1,11 @@
+case <+++> in
+
+ <++> )
+ <++>
+ ;;
+
+ * )
+ <++>
+ ;;
+
+esac
diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt
index 245ff49..64d3a2e 100644
--- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt
+++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt
@@ -7,17 +7,20 @@
usageMessage="Usage: template.sh [-ac] [-b OPTARG] FILE..."
# Process options
-while getopts ":ab:c" opt; do
+while getopts ':ab:c' opt; do
case $opt in
'a' )
- echo a ;;
+ echo a
+ ;;
'b' )
- echo b $OPTARG ;;
+ echo b $OPTARG
+ ;;
'c' )
- echo c ;;
+ echo c
+ ;;
'?' )
printf "${usageMessage}\n"