Skip to content

Commit

Permalink
install modes.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Dec 27, 2024
1 parent 027b65b commit 27aa992
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@
url = github:lukas-reineke/indent-blankline.nvim;
flake = false;
};
modes-nvim = {
url = github:mvllow/modes.nvim;
flake = false;
};
nvim-web-devicons = {
url = github:kyazdani42/nvim-web-devicons;
flake = false;
Expand Down
1 change: 1 addition & 0 deletions modules/visuals/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ with lib;
vim.visuals = {
enable = mkDefault false;

modes.enable = mkDefault true;
noice.enable = mkDefault true;
nvimWebDevicons.enable = mkDefault false;
lspkind.enable = mkDefault false;
Expand Down
40 changes: 40 additions & 0 deletions modules/visuals/visuals.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ in
description = "visual enhancements";
};

modes = {
enable = mkOption {
type = types.bool;
description = "enable modes.nvim: Prismatic line decorations for the adventurous vim user";
};

lineOpacity = mkOption {
type = types.float;
default = 0.15;
description = "the opacity for cursorline and number background";
};

colors = {
insert = mkOption {
type = types.str;
default = "#27ff00";
};
visual = mkOption {
type = types.str;
default = "#8927ff";
};
};
};

noice.enable = mkOption {
type = types.bool;
description = "enable the noice plugin";
Expand Down Expand Up @@ -72,6 +96,7 @@ in
config = mkIf cfg.enable
{
vim.startPlugins = with pkgs.neovimPlugins; (
(withPlugins cfg.modes.enable [ modes-nvim ]) ++
(withPlugins cfg.noice.enable [ noice nui-nvim ]) ++
(withPlugins cfg.nvimWebDevicons.enable [ nvim-web-devicons ]) ++
(withPlugins cfg.lspkind.enable [ lspkind ]) ++
Expand Down Expand Up @@ -113,6 +138,21 @@ in
''
}
${writeIf cfg.modes.enable ''
require('modes').setup({
colors = {
bg = "", -- Optional bg param, defaults to Normal hl group
copy = "#fcd85c", -- don't care about this, interferes with which-key
delete = "#f05454", -- also interferes with which-key and workaroound is too slow
insert = "${cfg.modes.colors.insert}",
visual = "${cfg.modes.colors.visual}",
},
-- Set opacity for cursorline and number background
line_opacity = ${toString cfg.modes.lineOpacity},
})
''
}
${writeIf cfg.noice.enable ''
${writeIf keys.enable ''
wk.register({
Expand Down

0 comments on commit 27aa992

Please sign in to comment.