2023-02-01 19:11:37 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
2024-05-15 09:51:07 +00:00
|
|
|
inherit (builtins) map;
|
2024-01-02 23:55:15 +00:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
2024-03-12 00:47:57 +00:00
|
|
|
inherit (lib.trivial) boolToString;
|
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
2024-03-16 09:29:32 +00:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
|
|
inherit (lib.generators) mkLuaInline;
|
2024-03-12 00:47:57 +00:00
|
|
|
|
2023-03-01 12:22:41 +00:00
|
|
|
cfg = config.vim.statusline.lualine;
|
2023-12-07 01:31:08 +00:00
|
|
|
breadcrumbsCfg = config.vim.ui.breadcrumbs;
|
2023-03-01 12:22:41 +00:00
|
|
|
in {
|
2024-01-02 23:55:15 +00:00
|
|
|
config = mkMerge [
|
|
|
|
# TODO: move into nvim-tree file
|
2024-07-08 21:57:58 +00:00
|
|
|
(mkIf config.vim.filetree.nvimTree.enable {
|
2024-01-02 23:55:15 +00:00
|
|
|
vim.statusline.lualine.setupOpts = {
|
|
|
|
extensions = ["nvim-tree"];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
(mkIf (breadcrumbsCfg.enable && breadcrumbsCfg.source == "nvim-navic") {
|
|
|
|
vim.statusline.lualine.setupOpts = {
|
|
|
|
# TODO: rewrite in new syntax
|
|
|
|
winbar.lualine_c = [
|
2024-04-06 16:14:47 +00:00
|
|
|
[
|
|
|
|
"navic"
|
|
|
|
(mkLuaInline "draw_empty = ${boolToString config.vim.ui.breadcrumbs.alwaysRender}")
|
|
|
|
]
|
2024-01-02 23:55:15 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
})
|
|
|
|
(mkIf cfg.enable {
|
2024-05-15 09:51:07 +00:00
|
|
|
vim = {
|
|
|
|
startPlugins = ["lualine"];
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2024-05-15 09:51:07 +00:00
|
|
|
luaConfigRC.lualine = entryAnywhere ''
|
|
|
|
local lualine = require('lualine')
|
|
|
|
lualine.setup ${toLuaObject cfg.setupOpts}
|
|
|
|
'';
|
2024-01-02 23:55:15 +00:00
|
|
|
|
2024-05-15 09:51:07 +00:00
|
|
|
# this is for backwards-compatibility
|
|
|
|
statusline.lualine.setupOpts = {
|
|
|
|
options = {
|
|
|
|
icons_enabled = cfg.icons.enable;
|
2024-07-08 21:57:58 +00:00
|
|
|
inherit (cfg) theme;
|
2024-05-15 09:51:07 +00:00
|
|
|
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
|
|
|
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
|
|
|
globalstatus = cfg.globalStatus;
|
2024-07-08 21:57:58 +00:00
|
|
|
inherit (cfg) refresh;
|
2024-05-15 09:51:07 +00:00
|
|
|
};
|
2024-01-26 18:16:56 +00:00
|
|
|
|
2024-05-15 09:51:07 +00:00
|
|
|
sections = {
|
|
|
|
lualine_a = map mkLuaInline (cfg.activeSection.a ++ cfg.extraActiveSection.a);
|
|
|
|
lualine_b = map mkLuaInline (cfg.activeSection.b ++ cfg.extraActiveSection.b);
|
|
|
|
lualine_c = map mkLuaInline (cfg.activeSection.c ++ cfg.extraActiveSection.c);
|
|
|
|
lualine_x = map mkLuaInline (cfg.activeSection.x ++ cfg.extraActiveSection.x);
|
|
|
|
lualine_y = map mkLuaInline (cfg.activeSection.y ++ cfg.extraActiveSection.y);
|
|
|
|
lualine_z = map mkLuaInline (cfg.activeSection.z ++ cfg.extraActiveSection.z);
|
|
|
|
};
|
|
|
|
|
|
|
|
inactive_sections = {
|
|
|
|
lualine_a = map mkLuaInline (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a);
|
|
|
|
lualine_b = map mkLuaInline (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b);
|
|
|
|
lualine_c = map mkLuaInline (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c);
|
|
|
|
lualine_x = map mkLuaInline (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x);
|
|
|
|
lualine_y = map mkLuaInline (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y);
|
|
|
|
lualine_z = map mkLuaInline (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z);
|
|
|
|
};
|
|
|
|
|
|
|
|
# probably don't need this?
|
|
|
|
tabline = [];
|
2024-01-02 23:55:15 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
2023-02-01 19:11:37 +00:00
|
|
|
}
|