1
0
Fork 0
mirror of https://github.com/luzifer/vim.git synced 2024-11-10 00:20:00 +00:00
vim/after/plugin/shfmt.vim
Knut Ahlers 3d2466581a
Automatically execute shfmt on shell script save
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-10-15 11:34:06 +02:00

10 lines
194 B
VimL

if exists('g:loaded_shfmt_wrapper')
finish
endif
let g:loaded_shfmt_wrapper = 1
function! SHFmt()
let save_pos = getpos(".")
execute "%!shfmt -s"
call setpos(".", save_pos)
endfunction