From 2b6a512de093fc181e597122ba46da804c0547b7 Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Fri, 7 Jun 2024 18:33:13 +0200 Subject: [PATCH] feat(plugins/astrocore): configure which-key groups name --- plugins/astrocore/default.nix | 4 +++- plugins/astrocore/mappings.nix | 16 +++++++++++++--- plugins/which-key.nix | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/plugins/astrocore/default.nix b/plugins/astrocore/default.nix index d94995c..8560aca 100644 --- a/plugins/astrocore/default.nix +++ b/plugins/astrocore/default.nix @@ -17,7 +17,7 @@ in ]; config = '' - require('astrocore').setup({ + require("astrocore").setup({ diagnostics = ${helpers.toLuaObject diagnostics}, features = ${helpers.toLuaObject features}, options = ${helpers.toLuaObject options.astrocore}, @@ -41,5 +41,7 @@ in inherit (autocmds) autoGroups autoCmd; inherit (mappings) keymaps; inherit (options) opts; + + plugins.which-key.registrations = mappings.mapSections; }; } diff --git a/plugins/astrocore/mappings.nix b/plugins/astrocore/mappings.nix index 225753a..a9f0f76 100644 --- a/plugins/astrocore/mappings.nix +++ b/plugins/astrocore/mappings.nix @@ -1,4 +1,6 @@ let + icons = import ../astroui/icons.nix; + forceWrite = { action = "silent! update! | redraw"; options.desc = "Force write"; @@ -559,7 +561,15 @@ in } ]; - mapSectionsLua = '' - - ''; + mapSections = { + "b".name = "${icons.Tab} Buffers"; + "bs".name = "${icons.Sort} Sort Buffers"; + "d".name = "${icons.Debugger} Debugger"; + "f".name = "${icons.Search} Find"; + "g".name = "${icons.Git} Git"; + "l".name = "${icons.ActiveLSP} Language Tools"; + "S".name = "${icons.Session} Session"; + "t".name = "${icons.Terminal} Terminal"; + "u".name = "${icons.Window} UI/UX"; + }; } diff --git a/plugins/which-key.nix b/plugins/which-key.nix index 39f6fde..bc92168 100644 --- a/plugins/which-key.nix +++ b/plugins/which-key.nix @@ -5,6 +5,7 @@ _: { opts = { enable = true; + icons.group = ""; window.border = "single"; # Disable which-key when in neo-tree or telescope