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', 'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
keys = { '<leader>', '<localleader>', '<c-r>', '<c-w>', '"', "'", '`', 'c', 'v', 'g' }, keys = { '<leader>', '<localleader>', '<c-r>', '<c-w>', '"', "'", '`', 'c', 'v', 'g' },
defaults = { defaults = {
mode = { 'n', 'v' }, mode = { 'n', 'v' },
@ -148,13 +149,14 @@ return {
['g'] = { name = '+goto' }, ['g'] = { name = '+goto' },
[']'] = { name = '+next' }, [']'] = { name = '+next' },
['['] = { name = '+prev' }, ['['] = { name = '+prev' },
['<leader>d'] = { name = '+lsp/debug' }, ['<leader>d'] = { name = '+[D]ebug' },
['<leader>r'] = { name = '+diagnostics/quickfix' }, ['<leader>c'] = { name = '+[C]ode/[C]olor' },
['<leader>c'] = { name = '+code' }, ['<leader>g'] = { name = '+[G]ood tools' },
['<leader>g'] = { name = '+git' }, ['<leader>f'] = { name = '+[F]ormatting' },
['<leader>t'] = { name = '+toggle/tools' }, ['<leader>r'] = { name = '[R]ename' },
['<leader>w'] = { name = '+window/which' }, ['<localleader>f'] = { name = '[F]ind' },
['<leader>f'] = { name = '+formatting' }, ['<leader>w'] = { name = '[W]orkspace' },
['<leader>t'] = { name = '[T]oggle' },
}, },
opts = { opts = {
triggers_nowait = { triggers_nowait = {
@ -233,28 +235,6 @@ return {
}) })
end, 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', 'RRethy/vim-illuminate',
lazy = false, lazy = false,
@ -262,7 +242,7 @@ return {
opts = { opts = {
-- providers: provider used to get references in the buffer, ordered by priority -- providers: provider used to get references in the buffer, ordered by priority
providers = { providers = {
'lsp', 'lsp', -- useless for tex but still used
'treesitter', 'treesitter',
'regex', 'regex',
}, },