aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2021-07-15 01:57:30 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2021-07-15 01:57:30 +0200
commit14791883624bf10227a6ffa9172c8030b87d4675 (patch)
tree8245e91cf4da07344dd1148b32c51d2b8c33f76d /stow/vim/.vim/ftplugin/sh
parentb8b7563bd9cf1731cb5dc2e34ed88d5bc1e336c8 (diff)
downloadconfigs-14791883624bf10227a6ffa9172c8030b87d4675.tar.gz
configs-14791883624bf10227a6ffa9172c8030b87d4675.zip
Lots of renames: stow can't handle folder with --dotfiles option.
Diffstat (limited to 'stow/vim/.vim/ftplugin/sh')
-rw-r--r--stow/vim/.vim/ftplugin/sh/sh.vim16
-rw-r--r--stow/vim/.vim/ftplugin/sh/snippets/if.txt3
2 files changed, 19 insertions, 0 deletions
diff --git a/stow/vim/.vim/ftplugin/sh/sh.vim b/stow/vim/.vim/ftplugin/sh/sh.vim
new file mode 100644
index 0000000..3eb4da5
--- /dev/null
+++ b/stow/vim/.vim/ftplugin/sh/sh.vim
@@ -0,0 +1,16 @@
+" ~/.vim/ftplugin/sh.vim
+" Bourne shell scripts specific vim configuration
+"
+" Linters: sh, shellcheck
+
+call matchadd('ColorColumn', '\%111v', 100)
+setlocal textwidth=110
+
+nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR>
+nnoremap <buffer> <leader>+x :!chmod 744 %<CR><CR>
+nnoremap <buffer> <leader>x :w<CR>:!./%<Space>
+nnoremap <buffer> <leader>e :Errors<CR>
+
+inoremap <buffer> <leader>sh #!/bin/sh
+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>
diff --git a/stow/vim/.vim/ftplugin/sh/snippets/if.txt b/stow/vim/.vim/ftplugin/sh/snippets/if.txt
new file mode 100644
index 0000000..9f6bb88
--- /dev/null
+++ b/stow/vim/.vim/ftplugin/sh/snippets/if.txt
@@ -0,0 +1,3 @@
+if <+++>; then
+ <++>
+fi<++>