mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-31 08:05:23 +02:00
Keymaps: Add keymapsOnEvent to load keymap on specified events (#1260)
This commit is contained in:
parent
f876a0a2e9
commit
303b9ca2c0
2 changed files with 97 additions and 19 deletions
|
@ -44,4 +44,38 @@
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
mkKeymapsOnEvents = {
|
||||
keymapsOnEvents = {
|
||||
"InsertEnter" =
|
||||
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 = "function() print('toto') end";
|
||||
lua = true;
|
||||
options.silent = false;
|
||||
}
|
||||
{
|
||||
mode = ["n" "v"];
|
||||
key = "<C-z>";
|
||||
action = "bar";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue