mirror of https://github.com/fredrikekre/.dotfiles
2 changed files with 26 additions and 16 deletions
@ -0,0 +1,26 @@ |
|||||||
|
-- https://github.com/mfussenegger/nvim-lint |
||||||
|
return { |
||||||
|
"mfussenegger/nvim-lint", |
||||||
|
config = function() |
||||||
|
local lint = require("lint") |
||||||
|
-- Configure linters by filetype |
||||||
|
lint.linters_by_ft = { |
||||||
|
sh = {"shellcheck"}, |
||||||
|
} |
||||||
|
-- Configure auto commands to trigger linting when opening and writing to disk |
||||||
|
vim.api.nvim_create_autocmd({"FileType"}, { |
||||||
|
pattern = "sh", |
||||||
|
once = true, |
||||||
|
callback = function() |
||||||
|
-- Trigger lint whenever writing to disk |
||||||
|
vim.api.nvim_create_autocmd({"BufWritePost"}, { |
||||||
|
callback = function() |
||||||
|
lint.try_lint("shellcheck") |
||||||
|
end, |
||||||
|
}) |
||||||
|
-- Trigger linting now |
||||||
|
lint.try_lint("shellcheck") |
||||||
|
end, |
||||||
|
}) |
||||||
|
end, |
||||||
|
} |
||||||
@ -1,16 +0,0 @@ |
|||||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim |
|
||||||
return { |
|
||||||
"jose-elias-alvarez/null-ls.nvim", |
|
||||||
dependencies = { |
|
||||||
{"nvim-lua/plenary.nvim"}, |
|
||||||
}, |
|
||||||
config = function() |
|
||||||
local null_ls = require("null-ls") |
|
||||||
local opts = { |
|
||||||
sources = { |
|
||||||
null_ls.builtins.diagnostics.shellcheck, |
|
||||||
}, |
|
||||||
} |
|
||||||
null_ls.setup(opts) |
|
||||||
end, |
|
||||||
} |
|
||||||
Loading…
Reference in new issue