Bash Extra
lang.bash adds the bash language server with shellcheck diagnostics for
shell scripts. Shell formatting with shfmt already ships in Blak core, so this
extra layers the language server on top of it.
Enable it
Section titled “Enable it”-- ~/.config/blak/lua/blak/user.luareturn { extras = { enabled = { "lang.bash", }, },}Or enable it interactively:
:BlakExtras enable lang.bashWhat it adds
Section titled “What it adds”| Surface | Contribution |
|---|---|
| Treesitter | bash |
| Mason | shellcheck |
| LSP | bashls, which runs shellcheck for sh and bash |
Formatting for sh, bash, and zsh with shfmt is part of Blak core and is
available whether or not this extra is enabled.
Shellcheck
Section titled “Shellcheck”bashls runs the Mason-installed shellcheck as you type, so there is no
separate nvim-lint linter and no duplicate diagnostics. <leader>ca on a
warning offers shellcheck’s fix or a # shellcheck disable= comment. Project
rules belong in .shellcheckrc.
To keep bashls but turn shellcheck off:
return { extras = { enabled = { "lang.bash" } }, lsp = { servers = { bashls = { settings = { bashIde = { shellcheckPath = "" }, }, }, }, },}Install and verify
Section titled “Install and verify”:BlakToolsInstall:BlakTreesitterInstall:BlakDoctorOpen a shell script and check :checkhealth vim.lsp for bashls. Shellcheck
diagnostics appear as soon as the file opens.