modules/neovim: separate options; move package into core/build

This commit is contained in:
raf 2024-02-19 11:18:18 +03:00
commit 199a8b06c5
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
9 changed files with 258 additions and 211 deletions

View file

@ -0,0 +1,61 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf;
cfg = config.vim;
in {
config = {
vim.maps = {
# normal mode mappings
normal =
mkIf cfg.disableArrows {
"<up>" = {
action = "<nop>";
noremap = false;
};
"<down>" = {
action = "<nop>";
noremap = false;
};
"<left>" = {
action = "<nop>";
noremap = false;
};
"<right>" = {
action = "<nop>";
noremap = false;
};
}
// mkIf cfg.mapLeaderSpace {
"<space>" = {
action = "<nop>";
};
};
# insert mode mappings
insert = mkIf cfg.disableArrows {
"<up>" = {
action = "<nop>";
noremap = false;
};
"<down>" = {
action = "<nop>";
noremap = false;
};
"<left>" = {
action = "<nop>";
noremap = false;
};
"<right>" = {
action = "<nop>";
noremap = false;
};
};
};
};
}