aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Grechannik <52157081+VlaDexa@users.noreply.github.com>2024-07-16 18:05:40 +0200
committerGitHub <noreply@github.com>2024-07-16 12:05:40 -0400
commitf5c919558b57afa7bdb921f4538c31ad9fcef9c2 (patch)
tree104977331159b8424f99219a1bb0570f6a36a914
parent5aeddfdd5d0308506ec63b0e4f8de33e2a39355f (diff)
which-key v3 update (#1022)
* which-key v3 update * remove unneeded brackets from which-key registration
-rw-r--r--init.lua20
1 files changed, 8 insertions, 12 deletions
diff --git a/init.lua b/init.lua
index 88658ef..907ef90 100644
--- a/init.lua
+++ b/init.lua
@@ -280,19 +280,15 @@ require('lazy').setup({
require('which-key').setup()
-- Document existing key chains
- require('which-key').register {
- ['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
- ['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
- ['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
- ['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
- ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
- ['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
- ['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
+ require('which-key').add {
+ { '<leader>c', group = '[C]ode' },
+ { '<leader>d', group = '[D]ocument' },
+ { '<leader>r', group = '[R]ename' },
+ { '<leader>s', group = '[S]earch' },
+ { '<leader>w', group = '[W]orkspace' },
+ { '<leader>t', group = '[T]oggle' },
+ { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
}
- -- visual mode
- require('which-key').register({
- ['<leader>h'] = { 'Git [H]unk' },
- }, { mode = 'v' })
end,
},