mirror of
https://github.com/luzifer/vim.git
synced 2024-09-18 18:42:55 +00:00
Automatically execute shfmt on shell script save
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
2fff453c3b
commit
3d2466581a
10
after/plugin/shfmt.vim
Normal file
10
after/plugin/shfmt.vim
Normal file
@ -0,0 +1,10 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user