zed-editor: add module
Add a simple module for zed-editor, a simple editor written in Rust.
This commit is contained in:
parent
9c1a1c7df4
commit
e78cbb2027
9 changed files with 210 additions and 0 deletions
39
tests/modules/programs/zed-editor/keymap.nix
Normal file
39
tests/modules/programs/zed-editor/keymap.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# 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}"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue