From 81b6ccff547b93d3e4cd007e7715feb2185ab8f7 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Mon, 1 Aug 2022 23:10:57 +0200 Subject: Updated vim templates for sh. --- stow/vim/.vim/ftplugin/sh/sh.vim | 4 ++-- stow/vim/.vim/ftplugin/sh/snippets/case.txt | 11 +++++++++++ stow/vim/.vim/ftplugin/sh/snippets/template.txt | 11 +++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 stow/vim/.vim/ftplugin/sh/snippets/case.txt 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 e :Errors let mapleader = "," -inoremap if if <+++>; then<++>fi<++>?<+++>cf> -"inoremap if :read ~/.vim/ftplugin/sh/snippets/if.txtkdd/<+++>cf> +inoremap if :read ~/.vim/ftplugin/sh/snippets/if.txtkdd/<+++>cf> +inoremap case :read ~/.vim/ftplugin/sh/snippets/case.txtkdd/<+++>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" -- cgit v1.2.1