1
0
Fork 0

Add diagnostics plugin and icons to Neovim configuration

This commit is contained in:
Avery 2025-03-11 13:53:51 +00:00
parent 1178b3ee53
commit 2d0d477a99
Signed by: Avery
GPG key ID: B684FD451B692E04
4 changed files with 193 additions and 139 deletions

View file

@ -7,6 +7,7 @@
./none-ls.nix ./none-ls.nix
./treesitter.nix ./treesitter.nix
./telescope.nix ./telescope.nix
./trouble.nix
]; ];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;

View file

@ -1,7 +1,21 @@
{ pkgs, ... }: { { ... }: {
programs.nixvim.plugins = { programs.nixvim.plugins = {
lsp = { lsp = {
enable = true; enable = true;
keymaps.lspBuf."<leader>ca" = "code_action";
luaConfig.post = ''
local signs = {
Error = "",
Warn = "",
Hint = "",
Info = ""
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
end
'';
servers = { servers = {
cssls.enable = true; cssls.enable = true;
dartls.enable = true; dartls.enable = true;

View file

@ -1,161 +1,175 @@
{ ... }: { { ... }: {
programs.nixvim = { programs.nixvim = {
keymaps = [ keymaps = [{
{ action = "<cmd>Neotree toggle<CR>";
action = "<cmd>Neotree toggle<CR>"; key = "<leader>fi";
key = "<leader>fi"; }];
}
];
plugins.neo-tree = { plugins.neo-tree = {
enable = true; enable = true;
closeIfLastWindow = true; closeIfLastWindow = true;
enableGitStatus = true; enableGitStatus = true;
enableDiagnostics = true; enableDiagnostics = true;
sourceSelector = { sourceSelector = {
winbar = true; winbar = true;
statusline = false; statusline = false;
tabsLayout = "equal"; tabsLayout = "equal";
sources = [ sources = [{
{ source = "filesystem"; displayName = " 󰉓 Archivos "; } source = "filesystem";
]; displayName = " 󰉓 Archivos ";
}];
}; };
defaultComponentConfigs = { defaultComponentConfigs = {
container = { container = { enableCharacterFade = true; };
enableCharacterFade = true; indent = {
indentSize = 2;
padding = 1;
withMarkers = true;
indentMarker = "";
lastIndentMarker = "";
highlight = "NeoTreeIndentMarker";
withExpanders = true;
expanderCollapsed = "";
expanderExpanded = "";
expanderHighlight = "NeoTreeExpander";
};
icon = {
folderClosed = "";
folderOpen = "";
folderEmpty = "";
default = " ";
highlight = "NeoTreeFileIcon";
};
modified = {
symbol = "[+]";
highlight = "NeoTreeModified";
};
name = {
trailingSlash = false;
useGitStatusColors = true;
highlight = "NeoTreeFileName";
};
gitStatus = {
symbols = {
added = "";
modified = "";
deleted = "";
renamed = "";
untracked = "";
ignored = "";
unstaged = "";
staged = "";
conflict = "";
}; };
indent = { };
indentSize = 2; diagnostics = {
padding = 1; symbols = {
withMarkers = true; error = "";
indentMarker = ""; warn = "";
lastIndentMarker = ""; hint = "";
highlight = "NeoTreeIndentMarker"; info = "";
withExpanders = true;
expanderCollapsed = "";
expanderExpanded = "";
expanderHighlight = "NeoTreeExpander";
}; };
icon = { highlights = {
folderClosed = ""; hint = "DiagnosticSignHint";
folderOpen = ""; info = "DiagnosticSignInfo";
folderEmpty = ""; warn = "DiagnosticSignWarn";
default = " "; error = "DiagnosticSignError";
highlight = "NeoTreeFileIcon";
};
modified = {
symbol = "[+]";
highlight = "NeoTreeModified";
};
name = {
trailingSlash = false;
useGitStatusColors = true;
highlight = "NeoTreeFileName";
};
gitStatus = {
symbols = {
added = "";
modified = "";
deleted = "";
renamed = "";
untracked = "";
ignored = "";
unstaged = "U";
staged = "";
conflict = "";
};
};
diagnostics = {
symbols = {
error = "";
warn = "";
hint = "";
info = "";
};
highlights = {
hint = "DiagnosticSignHint";
info = "DiagnosticSignInfo";
warn = "DiagnosticSignWarn";
error = "DiagnosticSignError";
};
}; };
};
}; };
window = { window = {
position = "left"; position = "left";
width = 40; width = 40;
mappingOptions = { mappingOptions = {
noremap = true; noremap = true;
nowait = true; nowait = true;
}; };
}; };
filesystem = { filesystem = {
bindToCwd = true; bindToCwd = true;
filteredItems = { filteredItems = {
visible = false; visible = false;
hideDotfiles = false; hideDotfiles = false;
hideGitignored = false; hideGitignored = false;
hideByName = [ hideByName = [ "nodeModules" ];
"nodeModules" };
]; groupEmptyDirs = false;
}; useLibuvFileWatcher = true;
groupEmptyDirs = false;
useLibuvFileWatcher = true;
};
buffers = {
groupEmptyDirs = true;
}; };
buffers = { groupEmptyDirs = true; };
renderers = { renderers = {
directory = [ directory = [
"indent" "indent"
"icon" "icon"
"current_filter" "current_filter"
{ {
name = "container"; name = "container";
content = [ content = [
{
name = "name";
zindex = 10;
}
{
name = "symlink_target";
zindex = 10;
highlight = "NeoTreeSymbolicLinkTarget";
}
{
name = "clipboard";
zindex = 10;
}
{
name = "diagnostics";
errorsOnly = true;
zindex = 20;
align = "right";
hideWhenExpanded = false;
}
{
name = "git_status";
zindex = 10;
align = "right";
hideWhenExpanded = true;
}
];
}
];
file = [
"indent"
"icon"
{ {
name = "container"; name = "name";
content = [ zindex = 10;
{ name = "name"; zindex = 10; } }
{ name = "clipboard"; zindex = 10;} {
{ name = "bufnr"; zindex = 10;} name = "symlink_target";
{ name = "modified"; zindex = 20; align = "right";} zindex = 10;
{ name = "diagnostics"; zindex = 20; align = "right";} highlight = "NeoTreeSymbolicLinkTarget";
{ name = "git_status"; zindex = 15; align = "right";} }
]; {
} name = "clipboard";
zindex = 10;
}
{
name = "diagnostics";
errorsOnly = true;
zindex = 20;
align = "right";
hideWhenExpanded = false;
}
{
name = "git_status";
zindex = 10;
align = "right";
hideWhenExpanded = true;
}
];
}
];
file = [
"indent"
"icon"
{
name = "container";
content = [
{
name = "name";
zindex = 10;
}
{
name = "clipboard";
zindex = 10;
}
{
name = "bufnr";
zindex = 10;
}
{
name = "modified";
zindex = 20;
align = "right";
}
{
name = "diagnostics";
zindex = 20;
align = "right";
}
{
name = "git_status";
zindex = 15;
align = "right";
}
];
}
]; ];
}; };
}; };
}; };
} }

View file

@ -0,0 +1,25 @@
{ ... }: {
programs.nixvim = {
plugins.trouble = {
enable = true;
settings = {
auto_refresh = true;
focus = true;
follow = false;
keys = {
"<cr>" = "jump_close";
"s" = "jump_vsplit";
"S" = "jump_split";
};
win = {
type = "float";
border = "rounded";
};
};
};
keymaps = [{
action = "<cmd>Trouble diagnostics toggle<cr>";
key = "<leader>dg";
}];
};
}