mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 08:49:48 +01:00
Compare commits
No commits in common. "1fd4a2a1b8892e806ada2fb1797c94e97e4d7088" and "355d4830e52ef9c2d378e612de38e0aee9f0ed7b" have entirely different histories.
1fd4a2a1b8
...
355d4830e5
3 changed files with 106 additions and 100 deletions
|
@ -35,6 +35,3 @@ Release notes for release 0.7
|
||||||
to nixpkgs. A pull request is currently open.
|
to nixpkgs. A pull request is currently open.
|
||||||
|
|
||||||
- Remove vim-tidal and friends
|
- Remove vim-tidal and friends
|
||||||
|
|
||||||
- Cleaned up Lualine module to reduce theme dependency on Catppuccin, and fixed
|
|
||||||
blending issues in component separators.
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) map;
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.trivial) boolToString;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
@ -32,46 +31,44 @@ in {
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf cfg.enable {
|
(mkIf cfg.enable {
|
||||||
vim = {
|
vim.startPlugins = [
|
||||||
startPlugins = ["lualine"];
|
"lualine"
|
||||||
|
];
|
||||||
|
|
||||||
luaConfigRC.lualine = entryAnywhere ''
|
vim.luaConfigRC.lualine = entryAnywhere ''
|
||||||
local lualine = require('lualine')
|
local lualine = require('lualine')
|
||||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# this is for backwards-compatibility
|
# this is for backwards-compatibility
|
||||||
statusline.lualine.setupOpts = {
|
vim.statusline.lualine.setupOpts = {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = cfg.icons.enable;
|
icons_enabled = cfg.icons.enable;
|
||||||
theme = cfg.theme;
|
theme = cfg.theme;
|
||||||
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
component_separators = [cfg.componentSeparator.left cfg.componentSeparator.right];
|
||||||
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
section_separators = [cfg.sectionSeparator.left cfg.sectionSeparator.right];
|
||||||
globalstatus = cfg.globalStatus;
|
globalstatus = cfg.globalStatus;
|
||||||
refresh = cfg.refresh;
|
refresh = cfg.refresh;
|
||||||
};
|
|
||||||
|
|
||||||
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 = [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
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 = [];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
|
@ -10,45 +10,19 @@
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
|
||||||
supported_themes = import ./supported_themes.nix;
|
supported_themes = import ./supported_themes.nix;
|
||||||
builtin_themes = [
|
colorPuccin =
|
||||||
"auto"
|
if config.vim.statusline.lualine.theme == "catppuccin"
|
||||||
"16color"
|
then "#181825"
|
||||||
"gruvbox"
|
else "none";
|
||||||
"ayu_dark"
|
|
||||||
"ayu_light"
|
|
||||||
"ayu_mirage"
|
|
||||||
"codedark"
|
|
||||||
"dracula"
|
|
||||||
"everforest"
|
|
||||||
"gruvbox"
|
|
||||||
"gruvbox_light"
|
|
||||||
"gruvbox_material"
|
|
||||||
"horizon"
|
|
||||||
"iceberg_dark"
|
|
||||||
"iceberg_light"
|
|
||||||
"jellybeans"
|
|
||||||
"material"
|
|
||||||
"modus_vivendi"
|
|
||||||
"molokai"
|
|
||||||
"nightfly"
|
|
||||||
"nord"
|
|
||||||
"oceanicnext"
|
|
||||||
"onelight"
|
|
||||||
"palenight"
|
|
||||||
"papercolor_dark"
|
|
||||||
"papercolor_light"
|
|
||||||
"powerline"
|
|
||||||
"seoul256"
|
|
||||||
"solarized_dark"
|
|
||||||
"tomorrow"
|
|
||||||
"wombat"
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
options.vim.statusline.lualine = {
|
options.vim.statusline.lualine = {
|
||||||
enable = mkEnableOption "lualine statusline plugin";
|
|
||||||
setupOpts = mkPluginSetupOption "Lualine" {};
|
setupOpts = mkPluginSetupOption "Lualine" {};
|
||||||
|
|
||||||
icons.enable = mkEnableOption "icons for lualine" // {default = true;};
|
enable = mkEnableOption "lualine statusline plugin";
|
||||||
|
|
||||||
|
icons = {
|
||||||
|
enable = mkEnableOption "icons for lualine" // {default = true;};
|
||||||
|
};
|
||||||
|
|
||||||
refresh = {
|
refresh = {
|
||||||
statusline = mkOption {
|
statusline = mkOption {
|
||||||
|
@ -99,15 +73,47 @@ in {
|
||||||
|
|
||||||
theme = let
|
theme = let
|
||||||
themeSupported = elem config.vim.theme.name supported_themes;
|
themeSupported = elem config.vim.theme.name supported_themes;
|
||||||
themesConcatted = builtin_themes ++ optional themeSupported config.vim.theme.name;
|
|
||||||
in
|
in
|
||||||
mkOption {
|
mkOption {
|
||||||
type = enum themesConcatted;
|
description = "Theme for lualine";
|
||||||
|
type = enum ([
|
||||||
|
"auto"
|
||||||
|
"16color"
|
||||||
|
"gruvbox"
|
||||||
|
"ayu_dark"
|
||||||
|
"ayu_light"
|
||||||
|
"ayu_mirage"
|
||||||
|
"codedark"
|
||||||
|
"dracula"
|
||||||
|
"everforest"
|
||||||
|
"gruvbox"
|
||||||
|
"gruvbox_light"
|
||||||
|
"gruvbox_material"
|
||||||
|
"horizon"
|
||||||
|
"iceberg_dark"
|
||||||
|
"iceberg_light"
|
||||||
|
"jellybeans"
|
||||||
|
"material"
|
||||||
|
"modus_vivendi"
|
||||||
|
"molokai"
|
||||||
|
"nightfly"
|
||||||
|
"nord"
|
||||||
|
"oceanicnext"
|
||||||
|
"onelight"
|
||||||
|
"palenight"
|
||||||
|
"papercolor_dark"
|
||||||
|
"papercolor_light"
|
||||||
|
"powerline"
|
||||||
|
"seoul256"
|
||||||
|
"solarized_dark"
|
||||||
|
"tomorrow"
|
||||||
|
"wombat"
|
||||||
|
]
|
||||||
|
++ optional themeSupported config.vim.theme.name);
|
||||||
default = "auto";
|
default = "auto";
|
||||||
# TODO: xml generation error if the closing '' is on a new line.
|
# TODO: xml generation error if the closing '' is on a new line.
|
||||||
# issue: https://gitlab.com/rycee/nmd/-/issues/10
|
# issue: https://gitlab.com/rycee/nmd/-/issues/10
|
||||||
defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"'';
|
defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"'';
|
||||||
description = "Theme for lualine";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sectionSeparator = {
|
sectionSeparator = {
|
||||||
|
@ -165,14 +171,15 @@ in {
|
||||||
"filetype",
|
"filetype",
|
||||||
colored = true,
|
colored = true,
|
||||||
icon_only = true,
|
icon_only = true,
|
||||||
icon = { align = 'left' }
|
icon = { align = 'left' },
|
||||||
|
color = {bg='${colorPuccin}', fg='lavender'},
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
''
|
''
|
||||||
{
|
{
|
||||||
"filename",
|
"filename",
|
||||||
symbols = {modified = ' ', readonly = ' '},
|
color = {bg='${colorPuccin}'},
|
||||||
separator = {right = ''}
|
symbols = {modified = '', readonly = ''},
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
];
|
];
|
||||||
|
@ -193,7 +200,13 @@ in {
|
||||||
removed = 'DiffDelete', -- Changes the diff's removed color you
|
removed = 'DiffDelete', -- Changes the diff's removed color you
|
||||||
},
|
},
|
||||||
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols
|
symbols = {added = '+', modified = '~', removed = '-'}, -- Changes the diff symbols
|
||||||
separator = {right = ''}
|
color = {
|
||||||
|
bg='${colorPuccin}',
|
||||||
|
fg='lavender'
|
||||||
|
},
|
||||||
|
separator = {
|
||||||
|
right = ''
|
||||||
|
},
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
];
|
];
|
||||||
|
@ -238,6 +251,10 @@ in {
|
||||||
return msg
|
return msg
|
||||||
end,
|
end,
|
||||||
icon = ' ',
|
icon = ' ',
|
||||||
|
color = {bg='${colorPuccin}', fg='lavender'},
|
||||||
|
separator = {
|
||||||
|
left = '',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
''
|
''
|
||||||
|
@ -245,6 +262,7 @@ in {
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'},
|
sources = {'nvim_lsp', 'nvim_diagnostic', 'coc'},
|
||||||
symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '},
|
symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '},
|
||||||
|
color = {bg='${colorPuccin}', fg='lavender'},
|
||||||
diagnostics_color = {
|
diagnostics_color = {
|
||||||
color_error = { fg = 'red' },
|
color_error = { fg = 'red' },
|
||||||
color_warn = { fg = 'yellow' },
|
color_warn = { fg = 'yellow' },
|
||||||
|
@ -264,16 +282,14 @@ in {
|
||||||
'searchcount',
|
'searchcount',
|
||||||
maxcount = 999,
|
maxcount = 999,
|
||||||
timeout = 120,
|
timeout = 120,
|
||||||
|
color = {bg='${colorPuccin}', fg='lavender'}
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
''
|
''
|
||||||
{
|
{
|
||||||
"branch",
|
"branch",
|
||||||
icon = ' •',
|
icon = ' •',
|
||||||
separator = {
|
color = {bg='${colorPuccin}', fg='lavender'},
|
||||||
left = '',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
];
|
];
|
||||||
|
@ -284,10 +300,17 @@ in {
|
||||||
description = "active config for: | A | B | C X | Y | (Z) |";
|
description = "active config for: | A | B | C X | Y | (Z) |";
|
||||||
default = [
|
default = [
|
||||||
''
|
''
|
||||||
{"progress"}
|
{
|
||||||
|
"progress",
|
||||||
|
separator = {
|
||||||
|
left = '',
|
||||||
|
},
|
||||||
|
}
|
||||||
''
|
''
|
||||||
''
|
''
|
||||||
{"location"}
|
{
|
||||||
|
"location",
|
||||||
|
}
|
||||||
''
|
''
|
||||||
''
|
''
|
||||||
{
|
{
|
||||||
|
@ -303,38 +326,32 @@ in {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraActiveSection = {
|
extraActiveSection = {
|
||||||
a = mkOption {
|
a = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for activeSection.a";
|
description = "Extra entries for activeSection.a";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
b = mkOption {
|
b = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for activeSection.b";
|
description = "Extra entries for activeSection.b";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
c = mkOption {
|
c = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for activeSection.c";
|
description = "Extra entries for activeSection.c";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
x = mkOption {
|
x = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for activeSection.x";
|
description = "Extra entries for activeSection.x";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
y = mkOption {
|
y = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for activeSection.y";
|
description = "Extra entries for activeSection.y";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
z = mkOption {
|
z = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for activeSection.z";
|
description = "Extra entries for activeSection.z";
|
||||||
|
@ -385,31 +402,26 @@ in {
|
||||||
description = "Extra entries for inactiveSection.a";
|
description = "Extra entries for inactiveSection.a";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
b = mkOption {
|
b = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for inactiveSection.b";
|
description = "Extra entries for inactiveSection.b";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
c = mkOption {
|
c = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for inactiveSection.c";
|
description = "Extra entries for inactiveSection.c";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
x = mkOption {
|
x = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for inactiveSection.x";
|
description = "Extra entries for inactiveSection.x";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
y = mkOption {
|
y = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for inactiveSection.y";
|
description = "Extra entries for inactiveSection.y";
|
||||||
default = [];
|
default = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
z = mkOption {
|
z = mkOption {
|
||||||
type = listOf str;
|
type = listOf str;
|
||||||
description = "Extra entries for inactiveSection.z";
|
description = "Extra entries for inactiveSection.z";
|
||||||
|
|
Loading…
Reference in a new issue