home: vim: configure 'null-ls' for 'bash'
This commit is contained in:
parent
e1a8c9e563
commit
e760f5aeaa
17
home/vim/after/ftplugin/bash.vim
Normal file
17
home/vim/after/ftplugin/bash.vim
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||||
|
call ftplugined#check_undo_ft()
|
||||||
|
|
||||||
|
" Set-up LSP, linters, formatters
|
||||||
|
lua << EOF
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
null_ls.register({
|
||||||
|
null_ls.builtins.diagnostics.shellcheck.with({
|
||||||
|
-- Require explicit empty string test, use bash dialect
|
||||||
|
extra_args = { "-s", "bash", "-o", "avoid-nullary-conditions" },
|
||||||
|
}),
|
||||||
|
null_ls.builtins.formatting.shfmt.with({
|
||||||
|
-- Indent with 4 spaces, simplify the code, indent switch cases, use bash dialect
|
||||||
|
extra_args = { "-i", "4", "-s", "-ci", "-ln", "bash" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
EOF
|
Loading…
Reference in a new issue