diff options
author | Damjan 9000 <damjan.9000@gmail.com> | 2024-02-26 20:46:46 +0100 |
---|---|---|
committer | Damjan 9000 <damjan.9000@gmail.com> | 2024-02-26 21:15:29 +0100 |
commit | 1ff3a155aab8ef8f9d14b51c382319fcd14e4da3 (patch) | |
tree | ff8e7695094365a18c3ca21bda1bd3f0bcf83444 /lua/kickstart/plugins/which-key.lua | |
parent | 4e7e6642a6a5b76c0dbb0e86748fcb12b4c95012 (diff) | |
parent | 8b5d48a199c02658e399f5b43ff8d06df1ede7fb (diff) |
Merge 'upstream/master' rewrite: slimmer, trimmer and more lazy kickstart.nvim
Diffstat (limited to 'lua/kickstart/plugins/which-key.lua')
-rw-r--r-- | lua/kickstart/plugins/which-key.lua | 34 |
1 files changed, 34 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..a3c1317 --- /dev/null +++ b/lua/kickstart/plugins/which-key.lua @@ -0,0 +1,34 @@ +-- 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 = 'VeryLazy' +-- +-- which loads which-key after all the UI elements are loaded. Events can be +-- normal autocommands events (:help autocomd-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 = 'VeryLazy', -- Sets the loading event to 'VeryLazy' + config = function() -- This is the function that runs, AFTER loading + require('which-key').setup() + + -- Document existing key chains + require('which-key').register { + ['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' }, + ['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, + ['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' }, + ['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, + ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, + } + end, + }, +} +-- vim: ts=2 sts=2 sw=2 et |