From b60a3234f19970e03b34f67f21a49ffafa3161b4 Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik <52157081+VlaDexa@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:05:40 +0200 Subject: [PATCH] which-key v3 update (#1022) * which-key v3 update * remove unneeded brackets from which-key registration --- init.lua | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/init.lua b/init.lua index 25b713d0ff9..c217e5af47d 100644 --- a/init.lua +++ b/init.lua @@ -282,17 +282,15 @@ require('lazy').setup({ 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' }, - ['s'] = { name = '[S]earch', _ = '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' }, - ['g'] = { - name = 'Debug', - s = { + require('which-key').add { + { 'c', group = '[C]ode' }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'g', group = 'Debug', mode = {s = { name = 'Step', c = { "lua require('dap').continue()", 'Continue' }, v = { "lua require('dap').step_over()", 'Step Over' }, @@ -329,11 +327,8 @@ require('lazy').setup({ c = { "lua require('dap').scopes()", 'Scopes' }, i = { "lua require('dap').toggle()", 'Toggle' }, }, - } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) + } + } end, },