From 5f1666094c22516722ce2515b88ad5192a482827 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sun, 26 Jan 2025 03:32:41 +0100 Subject: [PATCH] Updated which-key config --- .../dot-config/nvim/lua/plugins/which-key.lua | 63 +++++++++++++++---- nvim/dot-config/nvim/lua/themes/gruvbox.lua | 3 + 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/nvim/dot-config/nvim/lua/plugins/which-key.lua b/nvim/dot-config/nvim/lua/plugins/which-key.lua index dec6da0..166bc72 100644 --- a/nvim/dot-config/nvim/lua/plugins/which-key.lua +++ b/nvim/dot-config/nvim/lua/plugins/which-key.lua @@ -2,22 +2,63 @@ return { "folke/which-key.nvim", opts = { - window = { + preset = "modern", + delay = function(ctx) + return ctx.plugin and 0 or 500 + end, + win = { border = "single", - margin = { 1, 5, 2, 3 }, - padding = { 0, 0, 0, 0 }, + padding = { 1, 1 }, + title = false, + }, + icons = { + mappings = false, + colors = false, + keys = { + Up = " ", + Down = " ", + Left = " ", + Right = " ", + C = " ", + M = " ", + S = " ", + CR = " ", + Esc = " ", + BS = "", + Space = " ", + Tab = " ", + F1 = " ", + F2 = " ", + F3 = " ", + F4 = " ", + F5 = " ", + F6 = " ", + F7 = " ", + F8 = " ", + F9 = " ", + F10 = " ", + F11 = " ", + F12 = " ", + }, }, }, init = function() -- TODO: Only make a category show up if there actually are any keybinds under it - require("which-key").register({ - ["g"] = { name = "[G]it", _ = "which_key_ignore" }, - ["b"] = { name = "[B]buffer", _ = "which_key_ignore" }, - ["s"] = { name = "[S]earch", _ = "which_key_ignore" }, - ["c"] = { name = "[C]ode", _ = "which_key_ignore" }, - ["d"] = { name = "[D]ocument", _ = "which_key_ignore" }, - ["w"] = { name = "[W]orkspace", _ = "which_key_ignore" }, - ["r"] = { name = "[R]e[N]ame", _ = "which_key_ignore" }, + require("which-key").add({ + { "b", group = "[B]buffer" }, + { "b_", hidden = true }, + { "c", group = "[C]ode" }, + { "c_", hidden = true }, + { "d", group = "[D]ocument" }, + { "d_", hidden = true }, + { "g", group = "[G]it" }, + { "g_", hidden = true }, + { "r", group = "[R]e[N]ame" }, + { "r_", hidden = true }, + { "s", group = "[S]earch" }, + { "s_", hidden = true }, + { "w", group = "[W]orkspace" }, + { "w_", hidden = true }, }) end, } diff --git a/nvim/dot-config/nvim/lua/themes/gruvbox.lua b/nvim/dot-config/nvim/lua/themes/gruvbox.lua index 665cef6..a103bcc 100644 --- a/nvim/dot-config/nvim/lua/themes/gruvbox.lua +++ b/nvim/dot-config/nvim/lua/themes/gruvbox.lua @@ -56,6 +56,9 @@ return { NeoTreeTabInactive = { fg = palette.light4, bg = palette.dark2 }, NeoTreeTabSeparatorActive = { link = "NeoTreeTabActive" }, NeoTreeTabSeparatorInactive = { link = "NeoTreeTabInactive" }, + WhichKey = { fg = palette.bright_aqua, bold = true }, + WhichKeyDesc = { fg = palette.light1 }, + WhichKeyGroup = { fg = palette.neutral_blue, bold = true }, }, })