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
./treesitter.nix
./telescope.nix
./trouble.nix
];
programs.nixvim = {
enable = true;

View file

@ -1,7 +1,21 @@
{ pkgs, ... }: {
{ ... }: {
programs.nixvim.plugins = {
lsp = {
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 = {
cssls.enable = true;
dartls.enable = true;

View file

@ -1,161 +1,175 @@
{ ... }: {
programs.nixvim = {
keymaps = [
{
action = "<cmd>Neotree toggle<CR>";
key = "<leader>fi";
}
];
keymaps = [{
action = "<cmd>Neotree toggle<CR>";
key = "<leader>fi";
}];
plugins.neo-tree = {
enable = true;
closeIfLastWindow = true;
enableGitStatus = true;
enableDiagnostics = true;
sourceSelector = {
winbar = true;
statusline = false;
tabsLayout = "equal";
sources = [
{ source = "filesystem"; displayName = " 󰉓 Archivos "; }
];
winbar = true;
statusline = false;
tabsLayout = "equal";
sources = [{
source = "filesystem";
displayName = " 󰉓 Archivos ";
}];
};
defaultComponentConfigs = {
container = {
enableCharacterFade = true;
container = { 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;
padding = 1;
withMarkers = true;
indentMarker = "";
lastIndentMarker = "";
highlight = "NeoTreeIndentMarker";
withExpanders = true;
expanderCollapsed = "";
expanderExpanded = "";
expanderHighlight = "NeoTreeExpander";
};
diagnostics = {
symbols = {
error = "";
warn = "";
hint = "";
info = "";
};
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 = "U";
staged = "";
conflict = "";
};
};
diagnostics = {
symbols = {
error = "";
warn = "";
hint = "";
info = "";
};
highlights = {
hint = "DiagnosticSignHint";
info = "DiagnosticSignInfo";
warn = "DiagnosticSignWarn";
error = "DiagnosticSignError";
};
highlights = {
hint = "DiagnosticSignHint";
info = "DiagnosticSignInfo";
warn = "DiagnosticSignWarn";
error = "DiagnosticSignError";
};
};
};
window = {
position = "left";
width = 40;
mappingOptions = {
noremap = true;
nowait = true;
};
position = "left";
width = 40;
mappingOptions = {
noremap = true;
nowait = true;
};
};
filesystem = {
bindToCwd = true;
filteredItems = {
visible = false;
hideDotfiles = false;
hideGitignored = false;
hideByName = [
"nodeModules"
];
};
groupEmptyDirs = false;
useLibuvFileWatcher = true;
};
buffers = {
groupEmptyDirs = true;
bindToCwd = true;
filteredItems = {
visible = false;
hideDotfiles = false;
hideGitignored = false;
hideByName = [ "nodeModules" ];
};
groupEmptyDirs = false;
useLibuvFileWatcher = true;
};
buffers = { groupEmptyDirs = true; };
renderers = {
directory = [
"indent"
"icon"
"current_filter"
{
name = "container";
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"
directory = [
"indent"
"icon"
"current_filter"
{
name = "container";
content = [
{
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";}
];
}
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";
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";
}];
};
}