nix-community.nixvim/tests/test-sources/modules/keymaps.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
1.8 KiB
Nix
Raw Normal View History

2023-09-10 09:59:22 +02:00
{ helpers, ... }:
{
example = {
keymaps = [
{
key = ",";
action = "<cmd>echo \"test\"<cr>";
}
{
2023-09-10 09:59:22 +02:00
mode = [
"n"
"s"
];
key = "<C-p>";
action = "<cmd>echo \"test\"<cr>";
}
];
2023-09-10 09:59:22 +02:00
};
2023-12-02 20:02:53 +01:00
mkKeymaps = {
2023-09-10 09:59:22 +02:00
keymaps =
helpers.keymaps.mkKeymaps
{
mode = "x";
options.silent = true;
}
[
{
mode = "n";
key = ",";
action = "<cmd>echo \"test\"<cr>";
}
{
# raw action using rawType
key = "<C-p>";
action.__raw = "function() print('hello') end";
}
{
key = "<C-a>";
action.__raw = "function() print('toto') end";
options.silent = false;
}
{
mode = [
"n"
"v"
];
key = "<C-z>";
action = "bar";
}
];
2024-05-05 19:39:35 +02:00
};
mkKeymapsOnEvents = {
keymapsOnEvents = {
"InsertEnter" =
helpers.keymaps.mkKeymaps
2024-05-05 19:39:35 +02:00
{
mode = "x";
options.silent = true;
2024-05-05 19:39:35 +02:00
}
[
{
mode = "n";
key = ",";
action = "<cmd>echo \"test\"<cr>";
2024-05-05 19:39:35 +02:00
}
{
# raw action using rawType
key = "<C-p>";
action.__raw = "function() print('hello') end";
2024-05-05 19:39:35 +02:00
}
{
key = "<C-a>";
action.__raw = "function() print('toto') end";
options.silent = false;
2024-05-05 19:39:35 +02:00
}
{
mode = [
"n"
"v"
];
key = "<C-z>";
action = "bar";
2024-05-05 19:39:35 +02:00
}
];
};
};
2023-03-22 07:42:02 +01:00
}