zed-editor: add module

Add a simple module for zed-editor, a simple editor written in Rust.
This commit is contained in:
libewa 2024-05-26 11:41:16 +02:00 committed by Robert Helgesson
parent 9c1a1c7df4
commit e78cbb2027
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
9 changed files with 210 additions and 0 deletions

View 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}"
'';
}