ShellCheck diagnostics inside Neovim.
- Asynchronous.
- No LSP involved.
- No ALE, Neomake or Syntastic needed.
- Supports sh/bash/dash/ksh.
- Runs only on
BufEnter
andBufWritePost
events. - Runs only when filetype is sh, bash or ksh.
shellcheck
available in$PATH
.nvim >= 0.7
.
Use your favorite plugin manager!
{
'pablos123/shellcheck.nvim',
config = function () require 'shellcheck-nvim'.setup {} end
}
Configure
{
'pablos123/shellcheck.nvim',
config = function ()
-- Pass options to the shellcheck command.
require 'shellcheck-nvim'.setup {
shellcheck_options = { '-x', '--enable=all', },
}
end
}
Set ShellCheck diagnostics for current buffer.
:lua ShellCheck.run()
Clean ShellCheck diagnostics for current buffer.
:lua ShellCheck.clean()
Force diagnostics for some wrapper.
#!/bin/false
# shellcheck shell=<sh/ksh/dash/bash>
Remeber to set the filetype too.
:set ft=<sh/ksh/bash>
dash
is not a valid vim/nvim
filetype.