mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
lualine: increase theme compatibility; fix component definitions
This commit is contained in:
parent
355d4830e5
commit
b5f38b8e5e
2 changed files with 96 additions and 105 deletions
|
@ -3,6 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) map;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
@ -31,44 +32,46 @@ in {
|
|||
};
|
||||
})
|
||||
(mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"lualine"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = ["lualine"];
|
||||
|
||||
vim.luaConfigRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
'';
|
||||
luaConfigRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
'';
|
||||
|
||||
# this is for backwards-compatibility
|
||||
vim.statusline.lualine.setupOpts = {
|
||||
options = {
|
||||
icons_enabled = cfg.icons.enable;
|
||||
theme = cfg.theme;
|
||||
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
||||
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
||||
globalstatus = cfg.globalStatus;
|
||||
refresh = cfg.refresh;
|
||||
};
|
||||
# this is for backwards-compatibility
|
||||
statusline.lualine.setupOpts = {
|
||||
options = {
|
||||
icons_enabled = cfg.icons.enable;
|
||||
theme = cfg.theme;
|
||||
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
||||
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
||||
globalstatus = cfg.globalStatus;
|
||||
refresh = cfg.refresh;
|
||||
};
|
||||
|
||||
sections = {
|
||||
lualine_a = builtins.map mkLuaInline (cfg.activeSection.a ++ cfg.extraActiveSection.a);
|
||||
lualine_b = builtins.map mkLuaInline (cfg.activeSection.b ++ cfg.extraActiveSection.b);
|
||||
lualine_c = builtins.map mkLuaInline (cfg.activeSection.c ++ cfg.extraActiveSection.c);
|
||||
lualine_x = builtins.map mkLuaInline (cfg.activeSection.x ++ cfg.extraActiveSection.x);
|
||||
lualine_y = builtins.map mkLuaInline (cfg.activeSection.y ++ cfg.extraActiveSection.y);
|
||||
lualine_z = builtins.map mkLuaInline (cfg.activeSection.z ++ cfg.extraActiveSection.z);
|
||||
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 = [];
|
||||
};
|
||||
inactive_sections = {
|
||||
lualine_a = builtins.map mkLuaInline (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a);
|
||||
lualine_b = builtins.map mkLuaInline (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b);
|
||||
lualine_c = builtins.map mkLuaInline (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c);
|
||||
lualine_x = builtins.map mkLuaInline (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x);
|
||||
lualine_y = builtins.map mkLuaInline (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y);
|
||||
lualine_z = builtins.map mkLuaInline (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z);
|
||||
};
|
||||
# probably don't need this?
|
||||
tabline = [];
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue