1
0
mirror of https://github.com/luzifer/vim.git synced 2024-09-19 19:12:55 +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

11 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