From 54834e72bf9dd5cc557fbdd09d4987d249a3cb32 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sun, 13 Apr 2025 14:40:31 +0200 Subject: [PATCH] docs: add section on keymaps in configuring.md --- docs/manual/configuring.md | 5 +++++ docs/manual/configuring/keymaps.md | 35 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 docs/manual/configuring/keymaps.md diff --git a/docs/manual/configuring.md b/docs/manual/configuring.md index f891c7a6..d913c487 100644 --- a/docs/manual/configuring.md +++ b/docs/manual/configuring.md @@ -1,6 +1,11 @@ # Configuring nvf {#ch-configuring} +This section gives a general overview of how to configure nvf. If something +specific you are looking for isn't covered here, try searching it in the +[options reference](#ch-options) + ```{=include=} chapters +configuring/keymaps.md configuring/custom-package.md configuring/custom-plugins.md configuring/overriding-plugins.md diff --git a/docs/manual/configuring/keymaps.md b/docs/manual/configuring/keymaps.md new file mode 100644 index 00000000..106da0b0 --- /dev/null +++ b/docs/manual/configuring/keymaps.md @@ -0,0 +1,35 @@ +# Custom keymaps {#ch-keymaps} + +Some plugin modules provide keymap options for convenience. If a keymap is not +provided by such options, you can easily add custom keymaps yourself via +`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"]; + lua = true; + action = '' + function() + require('foo').do_thing() + print('did thing') + end + ''; + } + ]; +} +```