mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
48 lines
957 B
Nix
48 lines
957 B
Nix
# Test custom keymap functionality
|
|
{ config, ... }:
|
|
|
|
{
|
|
programs.zed-editor = {
|
|
enable = true;
|
|
package = config.lib.test.mkStubPackage { };
|
|
mutableUserKeymaps = false;
|
|
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}"
|
|
'';
|
|
}
|