1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00
home-manager/tests/modules/programs/zed-editor/keymap.nix
libewa e78cbb2027
zed-editor: add module
Add a simple module for zed-editor, a simple editor written in Rust.
2024-10-17 16:15:20 +02:00

39 lines
827 B
Nix

# Test custom keymap functionality
{ config, ... }:
{
programs.zed-editor = {
enable = true;
package = config.lib.test.mkStubPackage { };
userKeymaps = [
{ bindings = { up = "menu::SelectPrev"; }; }
{
context = "Editor";
bindings = { escape = "editor::Cancel"; };
}
];
};
nmt.script = let
expectedContent = builtins.toFile "expected.json" ''
[
{
"bindings": {
"up": "menu::SelectPrev"
}
},
{
"bindings": {
"escape": "editor::Cancel"
},
"context": "Editor"
}
]
'';
keymapPath = ".config/zed/keymap.json";
in ''
assertFileExists "home-files/${keymapPath}"
assertFileContent "home-files/${keymapPath}" "${expectedContent}"
'';
}