mirror of
https://github.com/dam9000/kickstart-modular.nvim.git
synced 2026-03-30 01:31:30 +00:00
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:
parent
b9f3965282
commit
177ff61483
38
init.lua
38
init.lua
@ -275,13 +275,16 @@ require('lazy').setup({
|
|||||||
-- See `:help gitsigns` to understand what the configuration keys do
|
-- See `:help gitsigns` to understand what the configuration keys do
|
||||||
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
|
---@module 'gitsigns'
|
||||||
|
---@type Gitsigns.Config
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
opts = {
|
opts = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = '+' },
|
add = { text = '+' }, ---@diagnostic disable-line: missing-fields
|
||||||
change = { text = '~' },
|
change = { text = '~' }, ---@diagnostic disable-line: missing-fields
|
||||||
delete = { text = '_' },
|
delete = { text = '_' }, ---@diagnostic disable-line: missing-fields
|
||||||
topdelete = { text = '‾' },
|
topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields
|
||||||
changedelete = { text = '~' },
|
changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -303,6 +306,9 @@ require('lazy').setup({
|
|||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter',
|
event = 'VimEnter',
|
||||||
|
---@module 'which-key'
|
||||||
|
---@type wk.Opts
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
opts = {
|
opts = {
|
||||||
-- delay between pressing a key and opening which-key (milliseconds)
|
-- delay between pressing a key and opening which-key (milliseconds)
|
||||||
delay = 0,
|
delay = 0,
|
||||||
@ -480,7 +486,13 @@ require('lazy').setup({
|
|||||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||||
-- Mason must be loaded before its dependents so we need to set it up here.
|
-- Mason must be loaded before its dependents so we need to set it up here.
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
||||||
{ 'mason-org/mason.nvim', opts = {} },
|
{
|
||||||
|
'mason-org/mason.nvim',
|
||||||
|
---@module 'mason.settings'
|
||||||
|
---@type MasonSettings
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
-- Maps LSP server names between nvim-lspconfig and Mason package names.
|
-- Maps LSP server names between nvim-lspconfig and Mason package names.
|
||||||
'mason-org/mason-lspconfig.nvim',
|
'mason-org/mason-lspconfig.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
@ -673,6 +685,8 @@ require('lazy').setup({
|
|||||||
desc = '[F]ormat buffer',
|
desc = '[F]ormat buffer',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
---@module 'conform'
|
||||||
|
---@type conform.setupOpts
|
||||||
opts = {
|
opts = {
|
||||||
notify_on_error = false,
|
notify_on_error = false,
|
||||||
format_on_save = function(bufnr)
|
format_on_save = function(bufnr)
|
||||||
@ -816,7 +830,15 @@ require('lazy').setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- Highlight todo, notes, etc in comments
|
-- Highlight todo, notes, etc in comments
|
||||||
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
{
|
||||||
|
'folke/todo-comments.nvim',
|
||||||
|
event = 'VimEnter',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
---@module 'todo-comments'
|
||||||
|
---@type TodoOptions
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
opts = { signs = false },
|
||||||
|
},
|
||||||
|
|
||||||
{ -- Collection of various small independent plugins/modules
|
{ -- Collection of various small independent plugins/modules
|
||||||
'nvim-mini/mini.nvim',
|
'nvim-mini/mini.nvim',
|
||||||
@ -892,7 +914,7 @@ require('lazy').setup({
|
|||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
||||||
-- you can continue same window with `<space>sr` which resumes last telescope search
|
-- you can continue same window with `<space>sr` which resumes last telescope search
|
||||||
}, {
|
}, { ---@diagnostic disable-line: missing-fields
|
||||||
ui = {
|
ui = {
|
||||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||||
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
||||||
|
|||||||
@ -2,4 +2,7 @@
|
|||||||
-- I promise not to create any merge conflicts in this directory :)
|
-- I promise not to create any merge conflicts in this directory :)
|
||||||
--
|
--
|
||||||
-- See the kickstart.nvim README for more information
|
-- See the kickstart.nvim README for more information
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
-- autopairs
|
-- autopairs
|
||||||
-- https://github.com/windwp/nvim-autopairs
|
-- https://github.com/windwp/nvim-autopairs
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
'windwp/nvim-autopairs',
|
'windwp/nvim-autopairs',
|
||||||
event = 'InsertEnter',
|
event = 'InsertEnter',
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
-- be extended to other languages as well. That's why it's called
|
-- be extended to other languages as well. That's why it's called
|
||||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
-- NOTE: Yes, you can install new plugins here!
|
-- NOTE: Yes, you can install new plugins here!
|
||||||
'mfussenegger/nvim-dap',
|
'mfussenegger/nvim-dap',
|
||||||
@ -86,11 +88,13 @@ return {
|
|||||||
|
|
||||||
-- Dap UI setup
|
-- Dap UI setup
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
-- For more information, see |:help nvim-dap-ui|
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
dapui.setup {
|
dapui.setup {
|
||||||
-- Set icons to characters that are more likely to work in every terminal.
|
-- Set icons to characters that are more likely to work in every terminal.
|
||||||
-- Feel free to remove or use ones that you like more! :)
|
-- Feel free to remove or use ones that you like more! :)
|
||||||
-- Don't feel like these are good choices.
|
-- Don't feel like these are good choices.
|
||||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
controls = {
|
controls = {
|
||||||
icons = {
|
icons = {
|
||||||
pause = '⏸',
|
pause = '⏸',
|
||||||
|
|||||||
@ -2,9 +2,14 @@
|
|||||||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||||
-- config. This will add also the recommended keymaps.
|
-- config. This will add also the recommended keymaps.
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
|
---@module 'gitsigns'
|
||||||
|
---@type Gitsigns.Config
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
opts = {
|
opts = {
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gitsigns = require 'gitsigns'
|
local gitsigns = require 'gitsigns'
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
{ -- Add indentation guides even on blank lines
|
{ -- Add indentation guides even on blank lines
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||||
-- See `:help ibl`
|
-- See `:help ibl`
|
||||||
main = 'ibl',
|
main = 'ibl',
|
||||||
|
---@module 'ibl'
|
||||||
|
---@type ibl.config
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
|
|
||||||
{ -- Linting
|
{ -- Linting
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
-- Neo-tree is a Neovim plugin to browse the file system
|
-- Neo-tree is a Neovim plugin to browse the file system
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
version = '*',
|
version = '*',
|
||||||
@ -13,6 +15,8 @@ return {
|
|||||||
keys = {
|
keys = {
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||||
},
|
},
|
||||||
|
---@module 'neo-tree'
|
||||||
|
---@type neotree.Config
|
||||||
opts = {
|
opts = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
window = {
|
window = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user