fix which-keys

This commit is contained in:
Christoph J. Scherr 2024-07-08 15:10:28 +02:00
parent ea7ecf138b
commit ae62c303c5
1 changed files with 10 additions and 30 deletions

View File

@ -140,6 +140,7 @@ return {
},
{
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
keys = { '<leader>', '<localleader>', '<c-r>', '<c-w>', '"', "'", '`', 'c', 'v', 'g' },
defaults = {
mode = { 'n', 'v' },
@ -148,13 +149,14 @@ return {
['g'] = { name = '+goto' },
[']'] = { name = '+next' },
['['] = { name = '+prev' },
['<leader>d'] = { name = '+lsp/debug' },
['<leader>r'] = { name = '+diagnostics/quickfix' },
['<leader>c'] = { name = '+code' },
['<leader>g'] = { name = '+git' },
['<leader>t'] = { name = '+toggle/tools' },
['<leader>w'] = { name = '+window/which' },
['<leader>f'] = { name = '+formatting' },
['<leader>d'] = { name = '+[D]ebug' },
['<leader>c'] = { name = '+[C]ode/[C]olor' },
['<leader>g'] = { name = '+[G]ood tools' },
['<leader>f'] = { name = '+[F]ormatting' },
['<leader>r'] = { name = '[R]ename' },
['<localleader>f'] = { name = '[F]ind' },
['<leader>w'] = { name = '[W]orkspace' },
['<leader>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 {
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
['<localleader>f'] = { name = '[F]ind', _ = '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' },
}
-- visual mode
require('which-key').register({
['<leader>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',
},