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.
This commit is contained in:
orip 2025-04-26 14:35:04 +03:00
parent 6ba2408cdf
commit dc977703b1
8 changed files with 62 additions and 10 deletions

View file

@ -2,4 +2,7 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
---@module 'lazy'
---@type LazySpec
return {}

View file

@ -1,6 +1,8 @@
-- autopairs
-- https://github.com/windwp/nvim-autopairs
---@module 'lazy'
---@type LazySpec
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',

View file

@ -6,6 +6,8 @@
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
---@module 'lazy'
---@type LazySpec
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
@ -100,11 +102,13 @@ return {
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
---@diagnostic disable-next-line: missing-fields
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
---@diagnostic disable-next-line: missing-fields
controls = {
icons = {
pause = '',

View file

@ -2,9 +2,14 @@
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
---@module 'lazy'
---@type LazySpec
return {
{
'lewis6991/gitsigns.nvim',
---@module 'gitsigns'
---@type Gitsigns.Config
---@diagnostic disable-next-line: missing-fields
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'

View file

@ -1,9 +1,13 @@
---@module 'lazy'
---@type LazySpec
return {
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
---@module 'ibl'
---@type ibl.config
opts = {},
},
}

View file

@ -1,3 +1,5 @@
---@module 'lazy'
---@type LazySpec
return {
{ -- Linting

View file

@ -1,6 +1,8 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
---@module 'lazy'
---@type LazySpec
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
@ -13,6 +15,8 @@ return {
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
},
---@module 'neo-tree'
---@type neotree.Config
opts = {
filesystem = {
window = {