From 80506176567f47eb8062e4cd658d90befab96f84 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 27 Jan 2026 11:50:45 +0300 Subject: [PATCH] docs/manual: add custom keybinds section; minor wording tweaks Co-Authored-by: horriblename Signed-off-by: NotAShelf Change-Id: Idefa75ca9a92f89d008977a88066515d6a6a6964 --- docs/manual/configuring.md | 1 + docs/manual/configuring/keybinds.md | 38 +++++++++++++++++++ docs/manual/configuring/overriding-plugins.md | 3 +- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 docs/manual/configuring/keybinds.md diff --git a/docs/manual/configuring.md b/docs/manual/configuring.md index 9a1b71cf..ce455ea7 100644 --- a/docs/manual/configuring.md +++ b/docs/manual/configuring.md @@ -17,6 +17,7 @@ configuring/custom-package.md configuring/custom-plugins.md configuring/overriding-plugins.md configuring/languages.md +configuring/keybinds.md configuring/dags.md configuring/dag-entries.md configuring/autocmds.md diff --git a/docs/manual/configuring/keybinds.md b/docs/manual/configuring/keybinds.md new file mode 100644 index 00000000..401799c1 --- /dev/null +++ b/docs/manual/configuring/keybinds.md @@ -0,0 +1,38 @@ +# Custom keymaps {#ch-keymaps} + +Some plugin modules provide keymap options for your convenience. If a keymap is +not provided by such module options, you may easily register your own custom +keymaps via {option}`vim.keymaps`. + +```nix +{ + config.vim.keymaps = [ + { + key = "m"; + mode = "n"; + silent = true; + action = ":make"; + } + { + key = "l"; + mode = ["n" "x"]; + silent = true; + action = "cnext"; + } + { + key = "k"; + mode = ["n" "x"]; + + # While `lua` is `true`, `action` is expected to be + # a valid Lua expression. + lua = true; + action = '' + function() + require('foo').do_thing() + print('did thing') + end + ''; + } + ]; +} +``` diff --git a/docs/manual/configuring/overriding-plugins.md b/docs/manual/configuring/overriding-plugins.md index 55979ce7..ad681517 100644 --- a/docs/manual/configuring/overriding-plugins.md +++ b/docs/manual/configuring/overriding-plugins.md @@ -14,11 +14,12 @@ vim.pluginOverrides = { rev = ""; hash = ""; }; + # It's also possible to use a flake input lazydev-nvim = inputs.lazydev-nvim; # Or a local path lazydev-nvim = ./lazydev; - # Or a npins pin... etc + # Or a npins pin nvfetcher source, etc. }; ```