summaryrefslogtreecommitdiff
path: root/home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-08-31 15:39:39 +0530
committersinanmohd <sinan@sinanmohd.com>2025-08-31 22:28:28 +0530
commit31458b74b81df4ef5101c01b26fc28fc32ee821b (patch)
tree15846c395e3ac5aa085a30d11833b6f531abb345 /home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua
parent07854ac073b6c4a3e749078fa113367105a7af08 (diff)
feat(home/common): init neovim
Diffstat (limited to 'home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua')
-rw-r--r--home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua69
1 files changed, 69 insertions, 0 deletions
diff --git a/home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua b/home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua
new file mode 100644
index 0000000..82eb4ad
--- /dev/null
+++ b/home/common/modules/neovim/config/lua/pacman/plugins/which-key.lua
@@ -0,0 +1,69 @@
+-- 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 `opts` key (recommended), the configuration runs
+-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
+
+return {
+ { -- Useful plugin to show you pending keybinds.
+ 'folke/which-key.nvim',
+ event = 'VimEnter', -- Sets the loading event to 'VimEnter'
+ opts = {
+ -- delay between pressing a key and opening which-key (milliseconds)
+ -- this setting is independent of vim.o.timeoutlen
+ delay = 0,
+ icons = {
+ -- set icon mappings to true if you have a Nerd Font
+ mappings = vim.g.have_nerd_font,
+ -- If you are using a Nerd Font: set icons.keys to an empty table which will use the
+ -- default which-key.nvim defined Nerd Font icons, otherwise define a string table
+ keys = vim.g.have_nerd_font and {} or {
+ Up = '<Up> ',
+ Down = '<Down> ',
+ Left = '<Left> ',
+ Right = '<Right> ',
+ C = '<C-…> ',
+ M = '<M-…> ',
+ D = '<D-…> ',
+ S = '<S-…> ',
+ CR = '<CR> ',
+ Esc = '<Esc> ',
+ ScrollWheelDown = '<ScrollWheelDown> ',
+ ScrollWheelUp = '<ScrollWheelUp> ',
+ NL = '<NL> ',
+ BS = '<BS> ',
+ Space = '<Space> ',
+ Tab = '<Tab> ',
+ F1 = '<F1>',
+ F2 = '<F2>',
+ F3 = '<F3>',
+ F4 = '<F4>',
+ F5 = '<F5>',
+ F6 = '<F6>',
+ F7 = '<F7>',
+ F8 = '<F8>',
+ F9 = '<F9>',
+ F10 = '<F10>',
+ F11 = '<F11>',
+ F12 = '<F12>',
+ },
+ },
+
+ -- Document existing key chains
+ spec = {
+ { '<leader>s', group = '[S]earch' },
+ { '<leader>t', group = '[T]oggle' },
+ { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
+ },
+ },
+ },
+}
+-- vim: ts=2 sts=2 sw=2 et