Contributions and suggestions are welcome!
If you’d like to contribute:
- Fork the repository.
- Make your changes in a feature branch.
- Open a pull request with your proposed changes.
For major changes, please open an issue to discuss what you’d like to improve.
Before submitting a pull request, please:
- Run the tests with
batsto ensure everything works as expected.
Tests are written for bats-core, a Bash testing framework. Currently tested with:
- Bash:
3.2.57(1)-release - Zsh:
5.9
Refer to the official Bats documentation for installation instructions.
- Syntax Checking: Use
bash -nto check for syntax errors. - Linting:
shellcheckprovides robust static analysis with LSP support.
Install bats-core macOS and Linux:
brew install bats-core
brew install shellcheckNeovim LSP Configuration for shellcheck Linting with the Lazy.nvim Plugin Manager
Install the Bash Language Server via npm:
npm install -g bash-language-server
Add the LSP configuration plugin to Lazy.nvim, if needed:
{
"neovim/nvim-lspconfig",
config = function()
require("lspconfig").bashls.setup {}
end,
},Ensure cmp is installed in your Lazy.nvim configuration, for example:
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp", -- LSP source for cmp
"hrsh7th/cmp-path", -- Path completion
"hrsh7th/cmp-buffer", -- Buffer completion
},
config = function()
local cmp = require("cmp")
cmp.setup({
mapping = cmp.mapping.preset.insert(),
sources = {
{ name = "nvim_lsp" }, -- Autocompletion from LSP
{ name = "path" },
{ name = "buffer" },
},
})
end,
},
Add the BashLS setup to your LSP config in Neovim, for example:
require("lspconfig").bashls.setup {
capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
filetypes = { "sh", "bash" }, -- Enable for Bash scripts
cmd = { "bash-language-server", "start" },
}