Browse Source

[nvim] Remove null-ls in favor of nvim-lint

master
Fredrik Ekre 1 year ago
parent
commit
0d645c32e9
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 26
      .config/nvim/lua/plugins/lint.lua
  2. 16
      .config/nvim/lua/plugins/nullls.lua

26
.config/nvim/lua/plugins/lint.lua

@ -0,0 +1,26 @@ @@ -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,
}

16
.config/nvim/lua/plugins/nullls.lua

@ -1,16 +0,0 @@ @@ -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…
Cancel
Save