Complete overhaul of repo structure based on nvix. See https://github.com/niksingh710/nvix Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
40 lines
958 B
Nix
40 lines
958 B
Nix
{ lib, ... }:
|
|
{
|
|
myvim.mkKey = rec {
|
|
# set of functions that returns attrs for keymap list
|
|
mkKeymap = mode: key: action: desc: {
|
|
inherit mode key action;
|
|
|
|
options = {
|
|
inherit desc;
|
|
silent = true;
|
|
noremap = true;
|
|
remap = true;
|
|
};
|
|
};
|
|
|
|
# use when no description is to be passed
|
|
mkKeymap' =
|
|
mode: key: action:
|
|
mkKeymap mode key action null;
|
|
|
|
mkKeymapWithOpts =
|
|
mode: key: action: desc: opts:
|
|
(mkKeymap mode key action desc) // { options = opts; };
|
|
|
|
# for which-key icon generation
|
|
# accepts a list of strings and returns a list of objects
|
|
# [{ __unkeyed, icon, group, hidden <optional boolean> }]
|
|
wKeyObj =
|
|
with builtins;
|
|
list:
|
|
{
|
|
__unkeyed = elemAt list 0;
|
|
icon = elemAt list 1;
|
|
group = elemAt list 2;
|
|
}
|
|
// lib.optionalAttrs (length list > 3) {
|
|
hidden = elemAt list 3;
|
|
};
|
|
};
|
|
}
|