aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2023-05-08 09:42:29 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2023-05-08 09:42:29 +0200
commit22bbedd73e2b31b5188b38ca3166e146c5f3d431 (patch)
tree64c8d6374dbd98c11230fde263dd64155959bef1 /stow/vim/.vim/ftplugin/sh
parente6bd59a9bc5a6ef70337151c107429088615bd85 (diff)
downloadconfigs-22bbedd73e2b31b5188b38ca3166e146c5f3d431.tar.gz
configs-22bbedd73e2b31b5188b38ca3166e146c5f3d431.zip
Bunch of changes.
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