pkg(nixvim): Refactor ui module for nixvim
This commit is contained in:
parent
3948d2b53d
commit
dbb0d61937
4 changed files with 97 additions and 9 deletions
|
|
@ -1,9 +0,0 @@
|
||||||
{...}: {
|
|
||||||
colorschemes.gruvbox-material = {
|
|
||||||
enable = true;
|
|
||||||
autoLoad = true;
|
|
||||||
};
|
|
||||||
plugins = {
|
|
||||||
bufferline.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
69
pkgs/nixvim/ui/bufferline.nix
Normal file
69
pkgs/nixvim/ui/bufferline.nix
Normal 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
7
pkgs/nixvim/ui/colorschemes.nix
Normal file
7
pkgs/nixvim/ui/colorschemes.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{...}: {
|
||||||
|
colorschemes.gruvbox = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
21
pkgs/nixvim/ui/lualine.nix
Normal file
21
pkgs/nixvim/ui/lualine.nix
Normal 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 = {};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue