feat(micro): add option to specify keybindings
Added option to specify custom micro keybindings, all options available can be seen at https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md
This commit is contained in:
parent
fa8c16e245
commit
64b3ffa49c
|
@ -31,6 +31,26 @@ in {
|
|||
for supported values.
|
||||
'';
|
||||
};
|
||||
|
||||
keybinds = mkOption {
|
||||
type = jsonFormat.type;
|
||||
default = {
|
||||
"Alt-/" = "lua:comment.comment";
|
||||
"CtrlUnderscore" = "lua:comment.comment";
|
||||
};
|
||||
example = literalExpression ''
|
||||
{
|
||||
"Ctrl-y" = "Undo";
|
||||
"Ctrl-z" = "Redo";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to
|
||||
{file}`$XDG_CONFIG_HOME/micro/bindings.json`. See
|
||||
<https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md>
|
||||
for supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -39,5 +59,8 @@ in {
|
|||
|
||||
xdg.configFile."micro/settings.json".source =
|
||||
jsonFormat.generate "micro-settings" cfg.settings;
|
||||
|
||||
xdg.configFile."micro/bindings.json".source =
|
||||
jsonFormat.generate "micro-keybinds" cfg.keybinds;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
autosu = false;
|
||||
cursorline = false;
|
||||
};
|
||||
|
||||
keybinds = {
|
||||
"Ctrl-y" = "Undo";
|
||||
"Ctrl-z" = "Redo";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.micro = { };
|
||||
|
@ -20,5 +25,13 @@
|
|||
"cursorline": false
|
||||
}
|
||||
''}
|
||||
|
||||
assertFileContent home-files/.config/micro/bindings.json \
|
||||
${builtins.toFile "micro-expected-keybinds.json" ''
|
||||
{
|
||||
"Ctrl-y": "Undo",
|
||||
"Ctrl-z": "Redo"
|
||||
}
|
||||
''}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue