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 {
|
|
|
|
{ '<leader>c', group = '[C]ode' },
|
|
|
|
{ '<leader>d', group = '[D]ocument' },
|
|
|
|
{ '<leader>r', group = '[R]ename' },
|
|
|
|
{ '<leader>s', group = '[S]earch' },
|
|
|
|
{ '<leader>w', group = '[W]orkspace' },
|
|
|
|
{ '<leader>t', group = '[T]oggle' },
|
|
|
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
2024-02-26 19:46:46 +00:00
|
|
|
}
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
-- vim: ts=2 sts=2 sw=2 et
|