aboutsummaryrefslogtreecommitdiff
path: root/lua/kickstart/plugins/which-key.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/kickstart/plugins/which-key.lua')
-rw-r--r--lua/kickstart/plugins/which-key.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua
new file mode 100644
index 0000000..135dc62
--- /dev/null
+++ b/lua/kickstart/plugins/which-key.lua
@@ -0,0 +1,36 @@
+-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
+--
+-- 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:
+-- event = 'VimEnter'
+--
+-- which loads which-key before all the UI elements are loaded. Events can be
+-- normal autocommands events (`:help autocmd-events`).
+--
+-- 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',
+ 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').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' } },
+ }
+ end,
+ },
+}
+-- vim: ts=2 sts=2 sw=2 et