From f728834aa3da83beb43f27cf5f6bd0e41e3a09bd Mon Sep 17 00:00:00 2001 From: Laszlo Bacsi Date: Thu, 26 Jun 2025 15:25:57 +0200 Subject: [PATCH] binds/which-key: allow deregistering binds or groups --- docs/release-notes/rl-0.8.md | 1 + modules/plugins/utility/binds/which-key/config.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index c01bc043..90db7b68 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -439,3 +439,4 @@ - Add [smart-splits.nvim] for navigating between Neovim windows and terminal multiplexer panes. Available at `vim.utility.smart-splits`. +- Allow deregistering which-key binds or groups by setting them to `null` diff --git a/modules/plugins/utility/binds/which-key/config.nix b/modules/plugins/utility/binds/which-key/config.nix index 68dbbfbf..625a6215 100644 --- a/modules/plugins/utility/binds/which-key/config.nix +++ b/modules/plugins/utility/binds/which-key/config.nix @@ -10,7 +10,7 @@ inherit (lib.nvim.dag) entryAnywhere; cfg = config.vim.binds.whichKey; - register = mapAttrsToList (n: v: mkLuaInline "{ '${n}', desc = '${v}' }") cfg.register; + register = mapAttrsToList (n: v: lib.lists.optional (! isNull v) (mkLuaInline "{ '${n}', desc = '${v}' }")) cfg.register; in { config = mkIf cfg.enable { vim = {