feat(nvim): Setup nvim-lint through nixvim config

This commit is contained in:
Jalil David Salamé Messina 2024-03-02 21:12:45 +01:00
parent b2b9477041
commit 439eec75c3
Signed by: jalil
GPG key ID: F016B9E770737A0B
3 changed files with 8 additions and 18 deletions

View file

@ -1,6 +1,5 @@
{ {
autoGroups."highlightOnYank" = { }; autoGroups."highlightOnYank" = { };
autoGroups."runLinter" = { };
autoGroups."lspConfig" = { }; autoGroups."lspConfig" = { };
autoGroups."restoreCursorPosition" = { }; autoGroups."restoreCursorPosition" = { };
autoCmd = [ autoCmd = [
@ -21,16 +20,6 @@
''; '';
}; };
} }
{
group = "runLinter";
event = "BufWritePost";
pattern = "*";
callback = {
__raw = ''
require("lint").try_lint()
'';
};
}
{ {
group = "restoreCursorPosition"; group = "restoreCursorPosition";
event = "BufReadPost"; event = "BufReadPost";

View file

@ -46,7 +46,6 @@ in
rustaceanvim rustaceanvim
idris2-nvim idris2-nvim
nui-nvim nui-nvim
nvim-lint
]) ])
++ (with pkgs.vimPlugins; [ ++ (with pkgs.vimPlugins; [
lualine-lsp-progress lualine-lsp-progress
@ -119,12 +118,6 @@ in
do -- Setup idris2-nvim do -- Setup idris2-nvim
require("idris2").setup { } require("idris2").setup { }
end end
do -- Setup nvim-lint
require("lint").linters_by_ft = {
latex = { "chktex", "typos" },
}
end
''; '';
}; };
}; };

View file

@ -14,4 +14,12 @@
treesitter.incrementalSelection.enable = true; treesitter.incrementalSelection.enable = true;
treesitter-context.enable = true; treesitter-context.enable = true;
trouble.enable = true; trouble.enable = true;
lint = {
enable = true;
lintersByFt = {
rust = [ "typos" ];
latex = [ "chktex" "typos" ];
markdown = [ "typos" ];
};
};
} }