Updating whic-key config

This commit is contained in:
juanito87 2025-04-14 13:12:18 -03:00
parent 9ce4a5cf52
commit b7014515cc
No known key found for this signature in database
GPG Key ID: EAB042894FD44AFD
2 changed files with 31 additions and 22 deletions

View File

@ -1,4 +1,4 @@
-- [[ Configure and install plugins ]] --[[ Configure and install plugins ]]
-- To check the current status of your plugins, run -- To check the current status of your plugins, run
-- :Lazy -- :Lazy
-- --
@ -18,6 +18,7 @@ require('lazy').setup({
-- One liners -- One liners
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
{ 'CRAG666/code_runner.nvim', config = true }, -- Exe3cute code within nvim.
-- Plugins with custom values -- Plugins with custom values
require 'plugins_config/which-key', -- Show created key bindings require 'plugins_config/which-key', -- Show created key bindings
@ -32,6 +33,7 @@ require('lazy').setup({
require 'plugins_config/mini', -- Collections of useful mini plugins, like around/surround require 'plugins_config/mini', -- Collections of useful mini plugins, like around/surround
require 'plugins_config/tree-sitter', -- manage lint, indentation and some othe language related tasks require 'plugins_config/tree-sitter', -- manage lint, indentation and some othe language related tasks
require 'plugins_config/harpoon', -- Improve workflow for multiple files require 'plugins_config/harpoon', -- Improve workflow for multiple files
-- require 'plugins_config/code_runner', -- Code runner
-- require 'plugins_config/copilot', -- copilot config -- require 'plugins_config/copilot', -- copilot config
-- Broken configs/Testing config -- Broken configs/Testing config

View File

@ -1,22 +1,29 @@
return { -- Useful plugin to show you pending keybinds. return { -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim', 'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter' event = 'VimEnter', -- Sets the loading event to 'VimEnter'
config = function() -- This is the function that runs, AFTER loading config = function() -- This is the function that runs, AFTER loading
require('which-key').setup() require('which-key').setup()
-- Document existing key chains -- Document existing key chains
require('which-key').register { require('which-key').add {
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' }, { '<leader>c', group = '[C]ode' },
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, { '<leader>c_', hidden = true },
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' }, { '<leader>d', group = '[D]ocument' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, { '<leader>d_', hidden = true },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, { '<leader>h', group = 'Git [H]unk' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, { '<leader>h_', hidden = true },
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, { '<leader>r', group = '[R]ename' },
{ '<leader>r_', hidden = true },
{ '<leader>s', group = '[S]earch' },
{ '<leader>s_', hidden = true },
{ '<leader>t', group = '[T]oggle' },
{ '<leader>t_', hidden = true },
{ '<leader>w', group = '[W]orkspace' },
{ '<leader>w_', hidden = true },
} }
-- visual mode -- visual mode
require('which-key').register({ require('which-key').add {
['<leader>h'] = { 'Git [H]unk' }, { '<leader>h', desc = 'Git [H]unk', mode = 'v' },
}, { mode = 'v' })
end,
} }
end,
}