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
|
2024-07-17 08:47:54 +00:00
|
|
|
require('which-key').add {
|
2024-07-18 18:54:53 +00:00
|
|
|
{ '<leader>c', group = '[C]ode-/[C]hange' },
|
2024-08-07 10:21:08 +00:00
|
|
|
{ '<leader>d', group = '[D]ocument' },
|
2024-07-17 08:47:54 +00:00
|
|
|
{ '<leader>r', group = '[R]ename' },
|
|
|
|
{ '<leader>s', group = '[S]earch' },
|
|
|
|
{ '<leader>w', group = '[W]orkspace' },
|
2024-07-25 18:34:16 +00:00
|
|
|
{ '<leader>t', group = '[T]oggle/[T]erminal', mode = { 'n', 'v' } },
|
2024-07-18 18:54:53 +00:00
|
|
|
{ '<leader>h', group = 'Git [H]unk/[H]arpoon', mode = { 'n', 'v' } },
|
|
|
|
{ '<leader>g', group = '[G]it/[G]lobal', mode = { 'n', 'v' } },
|
|
|
|
{ '<leader>b', group = '[B]uffer/[B]reakpoint' },
|
|
|
|
{ '<leader>cd', group = '[D]irectory' },
|
|
|
|
{ '<leader>l', group = '[L]ist', mode = { 'n', 'v' } },
|
|
|
|
{ '<leader>f', group = '[F]ormat/[F]ile', mode = { 'n', 'v' } },
|
|
|
|
{ '<leader>o', group = '[O]verseer', mode = { 'n', 'v' } },
|
2024-02-26 19:46:46 +00:00
|
|
|
}
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
-- vim: ts=2 sts=2 sw=2 et
|