vim-shfmt
vim-shfmt copied to clipboard
Not running on save. Did I skip a step?
- I've installed
shfmt
:curl -sS https://webinstall.dev/shfmt | bash
- I've installed
vim-shfmt
in the vim 8 plugin style:mkdir -p ~/.vim/pack/plugins/start/ git clone --depth=1 https://github.com/z0mbix/vim-shfmt.git ~/.vim/pack/plugins/start/shfmt
- I've created a file with the options I want:
~/vim/plugins/shfmt.vim let g:shfmt_extra_args = '-i 4 -sr -s' let g:shfmt_fmt_on_save = 1
- I've sourced that file in my
~/.vimrc
:" Shfmt: TODO add to Webi source ~/.vim/plugins/shfmt.vim
Now if I run :Shfmt
I can see that it indents, but it's not indenting on save.
What have I misunderstood or done wrong?
Are your settings actually in ~/vim/plugins/shfmt.vim
or was that a typo?
also, is the file you’re editing detected as a shell script (filetype sh)?