Bruno BELANYI
f551c4fc30
This avoids the big red warning on each file that tries to use those sources...
27 lines
928 B
VimL
27 lines
928 B
VimL
" 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")
|
|
local utils = require("ambroisie.utils")
|
|
|
|
null_ls.register({
|
|
null_ls.builtins.diagnostics.shellcheck.with({
|
|
-- Show error code in message
|
|
diagnostics_format = "[#{c}] #{m}",
|
|
-- Require explicit empty string test
|
|
extra_args = { "-o", "avoid-nullary-conditions" },
|
|
-- Only used if available
|
|
condition = utils.is_executable_condition("shellcheck"),
|
|
}),
|
|
null_ls.builtins.formatting.shfmt.with({
|
|
-- Indent with 4 spaces, simplify the code, indent switch cases,
|
|
-- add space after redirection, use POSIX
|
|
extra_args = { "-i", "4", "-s", "-ci", "-sr", "-ln", "posix" },
|
|
-- Only used if available
|
|
condition = utils.is_executable_condition("shfmt"),
|
|
}),
|
|
})
|
|
EOF
|