nvim.nix/config/plugins/ui/lualine.nix

84 lines
1.7 KiB
Nix
Raw Normal View History

2024-08-08 09:58:48 +08:00
{...}: {
2024-08-04 21:19:37 +08:00
plugins.lualine = {
enable = true;
globalstatus = true;
theme = "gruvbox-material";
# Load our extensions
extensions = [
2024-08-04 21:23:43 +08:00
"neo-tree"
2024-08-04 21:19:37 +08:00
];
# Icons for our separators
2024-08-08 09:58:48 +08:00
componentSeparators = {
left = "";
right = "";
};
sectionSeparators = {
left = "";
right = "";
};
2024-08-04 21:19:37 +08:00
# Display components in tabline
2024-08-06 16:05:45 +08:00
tabline = {
2024-08-08 09:58:48 +08:00
lualine_a = [{name = "buffers";}];
lualine_x = [{name = "hostname";}];
lualine_z = [{name = "encoding";}];
2024-08-06 16:05:45 +08:00
};
2024-08-04 21:19:37 +08:00
# Lualine has sections as shown below
# +-------------------------------------------------+
# | A | B | C X | Y | Z |
# +-------------------------------------------------+
sections = {
# Section A
2024-08-08 09:58:48 +08:00
lualine_a = [{name = "mode";}];
2024-08-04 21:19:37 +08:00
# Section B
lualine_b = [
# Git branch
2024-08-08 09:58:48 +08:00
{
name = "branch";
icon = "";
}
2024-08-04 21:19:37 +08:00
# Git diff status
2024-08-08 09:58:48 +08:00
{
name = "diff";
2024-08-04 21:19:37 +08:00
extraConfig.symbols = {
2024-08-06 16:05:45 +08:00
added = "+";
modified = "~";
removed = "-";
2024-08-04 21:19:37 +08:00
};
}
2024-08-06 16:05:45 +08:00
];
# Section C
2024-08-08 09:58:48 +08:00
lualine_c = [{name = "filename";}];
2024-08-04 21:19:37 +08:00
2024-08-06 16:05:45 +08:00
# Section X
lualine_x = [
2024-08-04 21:19:37 +08:00
# Diagnostic count from nvim_lsp
2024-08-08 09:58:48 +08:00
{
name = "diagnostics";
2024-08-04 21:19:37 +08:00
extraConfig = {
2024-08-08 09:58:48 +08:00
sources = ["nvim_lsp"];
2024-08-04 21:19:37 +08:00
symbols = {
2024-08-06 16:05:45 +08:00
error = "error:";
warn = "warning:";
info = "info:";
hint = "hint:";
2024-08-04 21:19:37 +08:00
};
};
}
];
# Section Y
2024-08-08 09:58:48 +08:00
lualine_y = [{name = "progress";}];
2024-08-04 21:19:37 +08:00
# Section Z
2024-08-08 09:58:48 +08:00
lualine_z = [{name = "location";}];
2024-08-04 21:19:37 +08:00
};
};
}