aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/sh/sh.vim
blob: 11ecb48371640764ed1477d08fa69554d8a2a082 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
" ~/.vim/ftplugin/sh.vim
" Bourne shell scripts specific vim configuration
"
" Linters: sh, shellcheck

call matchadd('ColorColumn', '\%111v', 100)
setlocal textwidth=110

" Mappings

let mapleader = " "

nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/sh/sh.vim<CR><CR>
nnoremap <buffer> <leader>+x :!chmod 744 %<CR>
nnoremap <buffer> <leader>x :w<CR>:!./%<CR><CR>
nnoremap <buffer> <leader>X :w<CR>:!./%<Space>

let mapleader = ","

inoremap <buffer> <leader>sh <Esc>:read ~/.vim/ftplugin/sh/snippets/template.txt<CR><CR>
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>