2024-03-18 17:50:47 +00:00
|
|
|
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
|
2024-02-26 19:46:46 +00:00
|
|
|
--
|
|
|
|
-- This is often very useful to both group configuration, as well as handle
|
|
|
|
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
|
|
|
--
|
|
|
|
-- For example, in the following configuration, we use:
|
2024-03-03 08:54:58 +00:00
|
|
|
-- event = 'VimEnter'
|
2024-02-26 19:46:46 +00:00
|
|
|
--
|
2024-03-03 08:54:58 +00:00
|
|
|
-- which loads which-key before all the UI elements are loaded. Events can be
|
2024-03-01 22:11:08 +00:00
|
|
|
-- normal autocommands events (`:help autocmd-events`).
|
2024-02-26 19:46:46 +00:00
|
|
|
--
|
|
|
|
-- Then, because we use the `config` key, the configuration only runs
|
|
|
|
-- after the plugin has been loaded:
|
|
|
|
-- config = function() ... end
|
|
|
|
|
|
|
|
return {
|
|
|
|
{ -- Useful plugin to show you pending keybinds.
|
|
|
|
'folke/which-key.nvim',
|
2024-03-03 08:54:58 +00:00
|
|
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
2024-02-26 19:46:46 +00:00
|
|
|
config = function() -- This is the function that runs, AFTER loading
|
|
|
|
require('which-key').setup()
|
|
|
|
|
|
|
|
-- Document existing key chains
|
|
|
|
require('which-key').register {
|
|
|
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
|
|
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
|
|
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
2024-04-03 18:38:34 +00:00
|
|
|
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' },
|
2024-04-03 18:38:51 +00:00
|
|
|
['<leader>dn'] = { name = '[D]elete [N]o', _ = 'which_key_ignore' },
|
2024-02-26 19:46:46 +00:00
|
|
|
}
|
2024-03-01 08:15:22 +00:00
|
|
|
|
|
|
|
-- register which-key VISUAL mode
|
|
|
|
-- required for visual <leader>hs (hunk stage) to work
|
|
|
|
require('which-key').register({
|
|
|
|
['<leader>'] = { name = 'VISUAL <leader>' },
|
|
|
|
['<leader>h'] = { 'Git [H]unk' },
|
2024-04-03 18:38:51 +00:00
|
|
|
['<leader>d'] = { name = '[D]elete', _ = 'which_key_ignore' },
|
2024-04-03 18:39:35 +00:00
|
|
|
['<leader>p'] = { name = '[P]aste', _ = 'which_key_ignore' },
|
2024-04-03 18:38:51 +00:00
|
|
|
['<leader>dn'] = { name = '[N]o', _ = 'which_key_ignore' },
|
2024-04-03 18:39:35 +00:00
|
|
|
['<leader>pn'] = { name = '[N]o', _ = 'which_key_ignore' },
|
2024-03-01 08:15:22 +00:00
|
|
|
}, { mode = 'v' })
|
2024-02-26 19:46:46 +00:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
-- vim: ts=2 sts=2 sw=2 et
|