neovim-flake/modules/statusline/lualine/config.nix

67 lines
2.0 KiB
Nix
Raw Normal View History

{
config,
lib,
...
}:
with lib; let
cfg = config.vim.statusline.lualine;
in {
config = (mkIf cfg.enable) {
vim.startPlugins = [
"lualine"
];
vim.luaConfigRC.lualine = nvim.dag.entryAnywhere ''
2023-06-07 01:36:02 +02:00
local lualine = require('lualine')
lualine.setup {
options = {
icons_enabled = ${boolToString cfg.icons.enable},
theme = "${cfg.theme}",
component_separators = {"${cfg.componentSeparator.left}","${cfg.componentSeparator.right}"},
section_separators = {"${cfg.sectionSeparator.left}","${cfg.sectionSeparator.right}"},
2023-06-07 01:36:02 +02:00
disabled_filetypes = { 'alpha' },
always_divide_middle = true,
globalstatus = ${boolToString cfg.globalStatus},
ignore_focus = {'NvimTree'},
extensions = {${optionalString config.vim.filetree.nvimTree.enable "'nvim-tree'"}},
refresh = {
statusline = ${toString cfg.refresh.statusline},
tabline = ${toString cfg.refresh.tabline},
winbar = ${toString cfg.refresh.winbar},
},
},
-- active sections
sections = {
lualine_a = ${cfg.activeSection.a},
lualine_b = ${cfg.activeSection.b},
lualine_c = ${cfg.activeSection.c},
lualine_x = ${cfg.activeSection.x},
lualine_y = ${cfg.activeSection.y},
lualine_z = ${cfg.activeSection.z},
},
--
inactive_sections = {
lualine_a = ${cfg.inactiveSection.a},
lualine_b = ${cfg.inactiveSection.b},
lualine_c = ${cfg.inactiveSection.c},
lualine_x = ${cfg.inactiveSection.x},
lualine_y = ${cfg.inactiveSection.y},
lualine_z = ${cfg.inactiveSection.z},
},
tabline = {},
${optionalString (config.vim.ui.breadcrumbs.source == "nvim-navic") ''
2023-07-19 22:05:38 +02:00
winbar = {
lualine_c = {
{
"navic",
draw_empty = ${toString config.vim.ui.breadcrumbs.alwaysRender}
2023-07-19 22:05:38 +02:00
}
}
},
''}
}
'';
};
}