pkg(nixvim): Refactor ui module for nixvim

This commit is contained in:
ulic-youthlic 2025-07-13 06:04:55 +08:00
parent 3948d2b53d
commit dbb0d61937
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
4 changed files with 97 additions and 9 deletions

View file

@ -1,9 +0,0 @@
{...}: {
colorschemes.gruvbox-material = {
enable = true;
autoLoad = true;
};
plugins = {
bufferline.enable = true;
};
}

View file

@ -0,0 +1,69 @@
{...}: {
youthlic.plugins.bufferline = {
enable = true;
settings = {
options = {
close_command = {
__raw =
#lua
''
function(n)
Snacks.bufdelete(n)
end
'';
};
right_mouse_command = {
__raw =
#lua
''
function(n)
Snacks.bufdelete(n)
end
'';
};
diagnostics = "nvim_lsp";
always_show_bufferline = false;
diagnostics_indicator = {
__raw =
#lua
''
function(_, _, diag)
local icons = {
Error = " ",
Warn = " ",
Hint = " ",
Info = " ",
}
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
.. (diag.warning and icons.Warn .. diag.warning or "")
return vim.trim(ret)
end
'';
};
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
{
filetype = "snacks_layout_box";
}
];
get_element_icon = {
__raw =
#lua
''
function(opts)
local icons = {
octo = "",
}
return icons[opts.filetype]
end
'';
};
};
};
};
}

View file

@ -0,0 +1,7 @@
{...}: {
colorschemes.gruvbox = {
enable = true;
settings = {
};
};
}

View file

@ -0,0 +1,21 @@
{...}: {
youthlic.plugins.lualine = {
enable = true;
luaConfig.pre =
#lua
''
do
vim.g.lualine_laststatus = vim.o.laststatus
if vim.fn.argc(-1) > 0 then
vim.o.statusline = " "
else
vim.o.laststatus = 0
end
end
do
vim.o.laststatus = vim.g.lualine_laststatus
end
'';
settings = {};
};
}