summaryrefslogtreecommitdiffstats
path: root/.config/nvim/after/ftplugin/sh.vim
blob: d735beef5b143367b0daec0397be94f0f5a859d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
setg formatprg=cmdfmt\ 80

function! UpdateFormatprg()
   let &g:formatprg = substitute( &g:formatprg , '\d\+$', &textwidth , "" )
endfunction

augroup UpdateFormatprgGroup
   autocmd!
   autocmd VimEnter,BufEnter * call UpdateFormatprg()
   autocmd OptionSet textwidth call UpdateFormatprg()
augroup END