diff options
Diffstat (limited to '.config/nvim/after/ftplugin/sh.vim')
-rw-r--r-- | .config/nvim/after/ftplugin/sh.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/.config/nvim/after/ftplugin/sh.vim b/.config/nvim/after/ftplugin/sh.vim new file mode 100644 index 0000000..d735bee --- /dev/null +++ b/.config/nvim/after/ftplugin/sh.vim | |||
@@ -0,0 +1,11 @@ | |||
1 | setg formatprg=cmdfmt\ 80 | ||
2 | |||
3 | function! UpdateFormatprg() | ||
4 | let &g:formatprg = substitute( &g:formatprg , '\d\+$', &textwidth , "" ) | ||
5 | endfunction | ||
6 | |||
7 | augroup UpdateFormatprgGroup | ||
8 | autocmd! | ||
9 | autocmd VimEnter,BufEnter * call UpdateFormatprg() | ||
10 | autocmd OptionSet textwidth call UpdateFormatprg() | ||
11 | augroup END | ||