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.
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 extra arguments to the shellcheck command.
require 'shellcheck-nvim'.setup {
extras = { '-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. Remeber to set ft=sh
too.
#!/bin/false
# shellcheck shell=bash