Skip to content

Commit de2053d

Browse files
committed
docs: add section on keymaps in configuring.md
1 parent d97f12c commit de2053d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

docs/manual/configuring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Configuring nvf {#ch-configuring}
22

3+
This section gives a general overview of how to configure nvf. If something
4+
specific you are looking for isn't covered here, try searching it in the
5+
[options reference](#ch-options)
6+
37
```{=include=} chapters
8+
configuring/keymaps.md
49
configuring/custom-package.md
510
configuring/custom-plugins.md
611
configuring/overriding-plugins.md

docs/manual/configuring/keymaps.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Custom keymaps {#ch-keymaps}
2+
3+
Some plugin modules provide keymap options for convenience. If a keymap is not
4+
provided by such options, you can easily add custom keymaps yourself via
5+
`vim.keymaps`:
6+
7+
```nix
8+
{...}: {
9+
config.vim.keymaps = [
10+
{
11+
key = "<leader>m";
12+
mode = "n";
13+
silent = true;
14+
action = ":make<CR>";
15+
}
16+
{
17+
key = "<leader>l";
18+
mode = ["n" "x"];
19+
silent = true;
20+
action = "<cmd>cnext<CR>";
21+
}
22+
{
23+
key = "<leader>k";
24+
mode = ["n" "x"];
25+
lua = true;
26+
action = ''
27+
function()
28+
require('foo').do_thing()
29+
print('did thing')
30+
end
31+
'';
32+
}
33+
];
34+
}
35+
```

0 commit comments

Comments
 (0)