mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-25 10:18:36 +02:00
plugins/which-key: add key group support for registrations (#802)
* plugins/which-key: add registration support for key groups Modified the type of registration to support registration of key groups with "groupkey" = { name = "name";};. * plugins/which-key: relax the restrition on the type of registrations and more tests have been added * plugins/which-key: add more tests for groups within groups
This commit is contained in:
parent
c1cbb00126
commit
7fbb9240de
2 changed files with 33 additions and 3 deletions
|
@ -14,7 +14,7 @@ with lib; {
|
||||||
package = helpers.mkPackageOption "whick-key-nvim" pkgs.vimPlugins.which-key-nvim;
|
package = helpers.mkPackageOption "whick-key-nvim" pkgs.vimPlugins.which-key-nvim;
|
||||||
|
|
||||||
registrations = mkOption {
|
registrations = mkOption {
|
||||||
type = with types; attrsOf str;
|
type = with types; attrsOf anything;
|
||||||
default = {};
|
default = {};
|
||||||
description = "Manually register the description of mappings.";
|
description = "Manually register the description of mappings.";
|
||||||
example = {
|
example = {
|
||||||
|
|
|
@ -7,8 +7,38 @@
|
||||||
plugins.which-key = {
|
plugins.which-key = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# Simple mapping with only Description
|
# Testing for registrations
|
||||||
registrations."ff" = "Test";
|
registrations."f" = {
|
||||||
|
prefix = "<leader>";
|
||||||
|
mode = ["n" "v" "i" "t" "c" "x" "s" "o"];
|
||||||
|
name = "Group Test";
|
||||||
|
f = "Label Test";
|
||||||
|
"1" = [
|
||||||
|
{
|
||||||
|
__raw = ''
|
||||||
|
function()
|
||||||
|
print("Raw Lua Code and List KeyMapping Test")
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
"Raw Lua Code and List KeyMapping Test"
|
||||||
|
];
|
||||||
|
"oo" = "Label Test 2";
|
||||||
|
"<tab>" = {
|
||||||
|
name = "Group in Group Test";
|
||||||
|
f = [
|
||||||
|
{
|
||||||
|
__raw = ''
|
||||||
|
function()
|
||||||
|
vim.cmd("echo 'Raw Lua Code and List KeyMapping Test 2'")
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
"Raw Lua Code and List KeyMapping Test 2"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
plugins = {
|
plugins = {
|
||||||
marks = true;
|
marks = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue