feat(plugins/astrocore): configure which-key groups name

This commit is contained in:
Nicolas Goudry 2024-06-07 18:33:13 +02:00
parent 2e8dbe9585
commit 2b6a512de0
No known key found for this signature in database
GPG key ID: 5FC434D9FFD1DF44
3 changed files with 17 additions and 4 deletions

View file

@ -17,7 +17,7 @@ in
]; ];
config = '' config = ''
require('astrocore').setup({ require("astrocore").setup({
diagnostics = ${helpers.toLuaObject diagnostics}, diagnostics = ${helpers.toLuaObject diagnostics},
features = ${helpers.toLuaObject features}, features = ${helpers.toLuaObject features},
options = ${helpers.toLuaObject options.astrocore}, options = ${helpers.toLuaObject options.astrocore},
@ -41,5 +41,7 @@ in
inherit (autocmds) autoGroups autoCmd; inherit (autocmds) autoGroups autoCmd;
inherit (mappings) keymaps; inherit (mappings) keymaps;
inherit (options) opts; inherit (options) opts;
plugins.which-key.registrations = mappings.mapSections;
}; };
} }

View file

@ -1,4 +1,6 @@
let let
icons = import ../astroui/icons.nix;
forceWrite = { forceWrite = {
action = "<cmd>silent! update! | redraw<cr>"; action = "<cmd>silent! update! | redraw<cr>";
options.desc = "Force write"; options.desc = "Force write";
@ -559,7 +561,15 @@ in
} }
]; ];
mapSectionsLua = '' mapSections = {
"<leader>b".name = "${icons.Tab} Buffers";
''; "<leader>bs".name = "${icons.Sort} Sort Buffers";
"<leader>d".name = "${icons.Debugger} Debugger";
"<leader>f".name = "${icons.Search} Find";
"<leader>g".name = "${icons.Git} Git";
"<leader>l".name = "${icons.ActiveLSP} Language Tools";
"<leader>S".name = "${icons.Session} Session";
"<leader>t".name = "${icons.Terminal} Terminal";
"<leader>u".name = "${icons.Window} UI/UX";
};
} }

View file

@ -5,6 +5,7 @@ _:
{ {
opts = { opts = {
enable = true; enable = true;
icons.group = "";
window.border = "single"; window.border = "single";
# Disable which-key when in neo-tree or telescope # Disable which-key when in neo-tree or telescope