From ae62c303c57e0c80e4774bcfbd1edf025851984f Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 8 Jul 2024 15:10:28 +0200 Subject: [PATCH] fix which-keys --- lua/custom/plugins/ui.lua | 40 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/lua/custom/plugins/ui.lua b/lua/custom/plugins/ui.lua index d55addc..bd2365e 100644 --- a/lua/custom/plugins/ui.lua +++ b/lua/custom/plugins/ui.lua @@ -140,6 +140,7 @@ return { }, { 'folke/which-key.nvim', + event = 'VimEnter', -- Sets the loading event to 'VimEnter' keys = { '', '', '', '', '"', "'", '`', 'c', 'v', 'g' }, defaults = { mode = { 'n', 'v' }, @@ -148,13 +149,14 @@ return { ['g'] = { name = '+goto' }, [']'] = { name = '+next' }, ['['] = { name = '+prev' }, - ['d'] = { name = '+lsp/debug' }, - ['r'] = { name = '+diagnostics/quickfix' }, - ['c'] = { name = '+code' }, - ['g'] = { name = '+git' }, - ['t'] = { name = '+toggle/tools' }, - ['w'] = { name = '+window/which' }, - ['f'] = { name = '+formatting' }, + ['d'] = { name = '+[D]ebug' }, + ['c'] = { name = '+[C]ode/[C]olor' }, + ['g'] = { name = '+[G]ood tools' }, + ['f'] = { name = '+[F]ormatting' }, + ['r'] = { name = '[R]ename' }, + ['f'] = { name = '[F]ind' }, + ['w'] = { name = '[W]orkspace' }, + ['t'] = { name = '[T]oggle' }, }, opts = { triggers_nowait = { @@ -233,28 +235,6 @@ return { }) end, }, - { -- Useful plugin to show you pending keybinds. - 'folke/which-key.nvim', - event = 'VimEnter', -- Sets the loading event to 'VimEnter' - config = function() -- This is the function that runs, AFTER loading - require('which-key').setup() - - -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['f'] = { name = '[F]ind', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, - } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) - end, - }, { 'RRethy/vim-illuminate', lazy = false, @@ -262,7 +242,7 @@ return { opts = { -- providers: provider used to get references in the buffer, ordered by priority providers = { - 'lsp', + 'lsp', -- useless for tex but still used 'treesitter', 'regex', },