dot-files/vim/.vim/ftplugin/sh.vim
Bruno BELANYI 4753e32c30 [ADD][VIM] Shellcheck options for ALE
I want shellcheck to detect which shell is most appropriate on the `sh`
filetype, but explicitly use the `bash` dialect on `bash` and `zsh`
filetypes.

I also really don't like nullary conditions in shell, so I'll screen for
those too.

I might turn on the 'quote-safe-variables' check too, because I think
quoting variables is a good habit to take.
2019-10-19 05:46:29 +02:00

9 lines
287 B
VimL

" Use shfmt as ALE fixer for sh
let b:ale_fixers=[ 'shfmt' ]
" Indent with 4 spaces, simplify the code, indent switch cases, use POSIX
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln posix'
" Require explicit empty string test
let b:ale_sh_shellcheck_options='-o avoid-nullary-conditions'