mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-21 19:09:49 +01:00
feat: modes.nvim
This commit is contained in:
parent
562230a625
commit
fccfff474a
9 changed files with 116 additions and 0 deletions
|
@ -429,6 +429,11 @@
|
|||
flake = false;
|
||||
};
|
||||
|
||||
modes-nvim = {
|
||||
url = "github:mvllow/modes.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Assistant
|
||||
copilot-lua = {
|
||||
url = "github:zbirenbaum/copilot.lua";
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
_: {
|
||||
imports = [
|
||||
./noice
|
||||
./modes
|
||||
./notifications
|
||||
];
|
||||
}
|
||||
|
|
20
modules/ui/modes/config.nix
Normal file
20
modules/ui/modes/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.ui.modes-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"modes-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.modes-nvim = nvim.dag.entryAnywhere ''
|
||||
require('modes').setup()
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/ui/modes/default.nix
Normal file
6
modules/ui/modes/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./modes.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
0
modules/ui/modes/modes.nix
Normal file
0
modules/ui/modes/modes.nix
Normal file
5
modules/ui/notifications/default.nix
Normal file
5
modules/ui/notifications/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
_: {
|
||||
imports = [
|
||||
./nvim-notify
|
||||
];
|
||||
}
|
30
modules/ui/notifications/nvim-notify/config.nix
Normal file
30
modules/ui/notifications/nvim-notify/config.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.notify.nvim-notify;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["nvim-notify"];
|
||||
|
||||
vim.luaConfigRC.nvim-notify = nvim.dag.entryAnywhere ''
|
||||
require('notify').setup {
|
||||
stages = "${cfg.stages}",
|
||||
timeout = ${toString cfg.timeout},
|
||||
background_colour = "${cfg.background_colour}",
|
||||
position = "${cfg.position}",
|
||||
icons = {
|
||||
ERROR = "${cfg.icons.ERROR}",
|
||||
WARN = "${cfg.icons.WARN}",
|
||||
INFO = "${cfg.icons.INFO}",
|
||||
DEBUG = "${cfg.icons.DEBUG}",
|
||||
TRACE = "${cfg.icons.TRACE}",
|
||||
},
|
||||
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/ui/notifications/nvim-notify/default.nix
Normal file
6
modules/ui/notifications/nvim-notify/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./config.nix
|
||||
./nvim-notify.nix
|
||||
];
|
||||
}
|
42
modules/ui/notifications/nvim-notify/nvim-notify.nix
Normal file
42
modules/ui/notifications/nvim-notify/nvim-notify.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; {
|
||||
options.vim.notify.nvim-notify = {
|
||||
enable = mkEnableOption "Enable nvim-notify plugin";
|
||||
stages = mkOption {
|
||||
type = types.enum ["fade_in_slide_out" "fade_in" "slide_out" "none"];
|
||||
default = "fade_in_slide_out";
|
||||
description = "The stages of the notification";
|
||||
};
|
||||
timeout = mkOption {
|
||||
type = types.int;
|
||||
default = 1000;
|
||||
description = "The timeout of the notification";
|
||||
};
|
||||
background_colour = mkOption {
|
||||
type = types.str;
|
||||
default = "#000000";
|
||||
description = "The background colour of the notification";
|
||||
};
|
||||
position = mkOption {
|
||||
type = types.enum ["top_left" "top_right" "bottom_left" "bottom_right"];
|
||||
default = "top_right";
|
||||
description = "The position of the notification";
|
||||
};
|
||||
icons = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {
|
||||
ERROR = "";
|
||||
WARN = "";
|
||||
INFO = "";
|
||||
DEBUG = "";
|
||||
TRACE = "";
|
||||
};
|
||||
description = "The icons of the notification";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue