refactor: complete overhaul
Complete overhaul of repo structure based on nvix. See https://github.com/niksingh710/nvix Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
parent
ff2c59724a
commit
61feed4086
75 changed files with 2916 additions and 2314 deletions
40
plugins/common/functions.nix
Normal file
40
plugins/common/functions.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue