aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/sh
diff options
context:
space:
mode:
Diffstat (limited to 'stow/vim/.vim/ftplugin/sh')
-rw-r--r--stow/vim/.vim/ftplugin/sh/sh.vim2
-rw-r--r--stow/vim/.vim/ftplugin/sh/snippets/template.txt10
2 files changed, 7 insertions, 5 deletions
diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim
index 58d39fe..f716617 100644
--- a/stow/vim/.vim/ftplugin/sh/sh.vim
+++ b/stow/vim/.vim/ftplugin/sh/sh.vim
@@ -11,7 +11,7 @@ setlocal textwidth=110
let mapleader = " "
nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR><CR>
-nnoremap <buffer> <leader>+x :!chmod 744 %<CR><CR>
+nnoremap <buffer> <leader>+x :!chmod 744 %<CR>
nnoremap <buffer> <leader>x :w<CR>:!./%<Space>
nnoremap <buffer> <leader>X :w<CR>:!./%<CR><CR>
diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt
index 171dcf8..8b257fe 100644
--- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt
+++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt
@@ -4,14 +4,16 @@
#
# Usage: template.sh [-ac] [-b OPTARG] FILE...
-usageMessage="Usage: ${0} [-ac] [-b OPTARG] FILE..."
+scriptName="${0##*/}"
+
+usageMessage="Usage: ${scriptName} [-ac] [-b OPTARG] FILE..."
error() {
- printf '%s error: %s\n' "$0" "$*" >&2
+ printf '%s error: %s\n' "$scriptName" "$*" >&2
}
errorAndUsage() {
- printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2
+ printf '%s error: %s\n%s\n' "$scriptName" "$*" "$usageMessage" >&2
}
# Process options
@@ -31,7 +33,7 @@ while getopts ':ab:c' opt; do
;;
'?' )
- printf '%s\n' "$usageMessage"
+ printf '%s\n' "$usageMessage" >&2
exit 1
esac