mirror of
https://github.com/dam9000/kickstart-modular.nvim.git
synced 2026-03-30 09:41:32 +00:00
Based on:
commit 177ff6148391742ccb7aaa93c05b95cd6fc853e2
Author: orip <oriori1703@gmail.com>
AuthorDate: Sat Apr 26 14:35:04 2025 +0300
Add type hints to plugin options where possible
This could help beginners to get autocompletion, catch mistakes earlier,
and allow them to skip the docs for simple configs.
This is not perfect because a lot of the plugins type all of their keys
as required, even though they have defaults, but this is good enough.
40 lines
1.4 KiB
Lua
40 lines
1.4 KiB
Lua
-- 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)`.
|
|
|
|
---@module 'lazy'
|
|
---@type LazySpec
|
|
return {
|
|
{ -- Useful plugin to show you pending keybinds.
|
|
'folke/which-key.nvim',
|
|
event = 'VimEnter',
|
|
---@module 'which-key'
|
|
---@type wk.Opts
|
|
---@diagnostic disable-next-line: missing-fields
|
|
opts = {
|
|
-- delay between pressing a key and opening which-key (milliseconds)
|
|
delay = 0,
|
|
icons = { mappings = vim.g.have_nerd_font },
|
|
|
|
-- Document existing key chains
|
|
spec = {
|
|
{ '<leader>s', group = '[S]earch', mode = { 'n', 'v' } },
|
|
{ '<leader>t', group = '[T]oggle' },
|
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first
|
|
{ 'gr', group = 'LSP Actions', mode = { 'n' } },
|
|
},
|
|
},
|
|
},
|
|
}
|
|
-- vim: ts=2 sts=2 sw=2 et
|