1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 04:23:34 +02:00
This commit is contained in:
Yash Garg 2024-05-01 20:50:59 +05:30 committed by GitHub
commit 6c105e394e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 0 deletions

View File

@ -31,6 +31,26 @@ in {
for supported values. 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 = xdg.configFile."micro/settings.json".source =
jsonFormat.generate "micro-settings" cfg.settings; jsonFormat.generate "micro-settings" cfg.settings;
xdg.configFile."micro/bindings.json".source =
jsonFormat.generate "micro-keybinds" cfg.keybinds;
}; };
} }

View File

@ -8,6 +8,11 @@
autosu = false; autosu = false;
cursorline = false; cursorline = false;
}; };
keybinds = {
"Ctrl-y" = "Undo";
"Ctrl-z" = "Redo";
};
}; };
test.stubs.micro = { }; test.stubs.micro = { };
@ -20,5 +25,13 @@
"cursorline": false "cursorline": false
} }
''} ''}
assertFileContent home-files/.config/micro/bindings.json \
${builtins.toFile "micro-expected-keybinds.json" ''
{
"Ctrl-y": "Undo",
"Ctrl-z": "Redo"
}
''}
''; '';
} }