Compare commits

...

4 commits

Author SHA1 Message Date
diniamo
8848fd08ea
Merge 554b36a4bf into ef413736e9 2024-10-07 05:43:11 +00:00
raf
ef413736e9
Merge branch 'main' into v0.7 2024-10-07 00:40:13 +00:00
Ching Pei Yang
e77632e4eb
lib: remove pointless type restriction (#408)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
2024-10-06 23:19:39 +00:00
Ching Pei Yang
b39b84490f
Docs/map rewrite (#403)
* doc: fix formatting

* docs: update keymaps section
2024-10-06 14:03:21 +00:00
3 changed files with 11 additions and 22 deletions

View file

@ -7,37 +7,26 @@ section contains a general overview to how you may utilize said functions.
## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings} ## Custom Key Mappings Support for a Plugin {#sec-custom-key-mappings}
To set a mapping, you should define it in `vim.maps.<<mode>>`. To set a mapping, you should define it in `vim.keymaps`.
The available modes are:
- normal
- insert
- select
- visual
- terminal
- normalVisualOp
- visualOnly
- operator
- insertCommand
- lang
- command
An example, simple keybinding, can look like this: An example, simple keybinding, can look like this:
```nix ```nix
{ {
vim.maps.normal = { vim.keymaps = [
"<leader>wq" = { {
key = "<leader>wq";
mode = ["n"];
action = ":wq<CR>"; action = ":wq<CR>";
silent = true; silent = true;
desc = "Save file and quit"; desc = "Save file and quit";
}; }
}; ];
} }
``` ```
There are many settings available in the options. Please refer to the There are many settings available in the options. Please refer to the
[documentation](https://notashelf.github.io/nvf/options.html#opt-vim.maps.command._name_.action) [documentation](https://notashelf.github.io/nvf/options.html#opt-vim.keymaps)
to see a list of them. to see a list of them.
**nvf** provides a list of helper commands, so that you don't have to write the **nvf** provides a list of helper commands, so that you don't have to write the

View file

@ -97,7 +97,7 @@ in {
default = {}; default = {};
type = submodule { type = submodule {
freeformType = attrsOf anything; freeformType = anything;
options = opts; options = opts;
}; };
}; };

View file

@ -1,5 +1,5 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption; inherit (lib.options) mkOption literalMD;
inherit (lib.types) either str listOf attrsOf nullOr submodule; inherit (lib.types) either str listOf attrsOf nullOr submodule;
inherit (lib.nvim.config) mkBool; inherit (lib.nvim.config) mkBool;
@ -42,7 +42,7 @@
See `:help map-modes` for a list of modes. See `:help map-modes` for a list of modes.
''; '';
example = ''`["n" "v" "c"]` for normal, visual and command mode''; example = literalMD ''`["n" "v" "c"]` for normal, visual and command mode'';
}; };
}; };
}; };