Add type annotations to plugin specs

This commit is contained in:
Marko Korhonen 2023-11-25 14:37:36 +02:00
parent 7bd4c6e93e
commit efcdb566b8
31 changed files with 56 additions and 14 deletions

View file

@ -1,11 +1,13 @@
-- AsciiDoc plugins are grouped together here
return {
-- Vim ♥️ Asciidoctor
--- @type LazyPluginSpec
{
"habamax/vim-asciidoctor",
ft = { "asciidoctor", "asciidoc" },
},
-- AsciiDoc preview
--- @type LazyPluginSpec
{
"tigion/nvim-asciidoc-preview",
ft = { "asciidoctor", "asciidoc" },

View file

@ -1,4 +1,5 @@
-- Automatic brackets
--- @type LazyPluginSpec
return {
"windwp/nvim-autopairs",
config = true

View file

@ -1,3 +1,5 @@
-- Bufferline
--- @type LazyPluginSpec
return {
"akinsho/bufferline.nvim",
version = "*",

View file

@ -1,4 +1,5 @@
-- Caddyfile syntax support
--- @type LazyPluginSpec
return {
"isobit/vim-caddyfile",
ft = "caddyfile",

View file

@ -1,4 +1,5 @@
-- Autoompletion
--- @type LazyPluginSpec
return {
"hrsh7th/nvim-cmp",
dependencies = {

View file

@ -1,3 +1,5 @@
-- Confirm before quit
--- @type LazyPluginSpec
return {
"yutkat/confirm-quit.nvim",
event = "CmdlineEnter",

View file

@ -1,4 +1,5 @@
-- GitHub Copilot
--- @type LazyPluginSpec
return {
"zbirenbaum/copilot.lua",
opts = {

View file

@ -1,4 +1,5 @@
-- Startup dashboard
--- @type LazyPluginSpec
return {
"glepnir/dashboard-nvim",
event = "VimEnter",

View file

@ -1,3 +1,5 @@
-- Show the current LSP context in winbar
--- @type LazyPluginSpec
return {
"Bekaboo/dropbar.nvim",
}

View file

@ -1,4 +1,5 @@
-- Neovim inside Firefox
--- @type LazyPluginSpec
return {
"glacambre/firenvim",
build = function()

View file

@ -1,2 +1,3 @@
-- Git commands
--- @type LazyPluginSpec
return { "tpope/vim-fugitive" }

View file

@ -1,4 +1,5 @@
-- Edit GPG encrypted files transparently
--- @type LazyPluginSpec
return {
"jamessan/vim-gnupg",
ft = { "gpg" },

View file

@ -1,4 +1,5 @@
-- Indent characters
--- @type LazyPluginSpec
return {
"lukas-reineke/indent-blankline.nvim",
--- @type ibl.config

View file

@ -1,4 +1,5 @@
-- Colorscheme
--- @type LazyPluginSpec
return {
"rebelot/kanagawa.nvim",
--- @type KanagawaConfig
@ -46,6 +47,7 @@ return {
}
end,
},
--- @param opts KanagawaConfig
config = function(_, opts)
require("kanagawa").setup(opts)
vim.cmd("colorscheme kanagawa")

View file

@ -1,4 +1,5 @@
-- Statusline
--- @type LazyPluginSpec
return {
"nvim-lualine/lualine.nvim",
dependencies = { "kyazdani42/nvim-web-devicons" },

View file

@ -1,4 +1,5 @@
-- Snippets plugin
--- @type LazyPluginSpec
return {
"L3MON4D3/LuaSnip",
-- Snippets collection

View file

@ -1,4 +1,5 @@
-- Markdown preview
--- @type LazyPluginSpec
return {
"iamcco/markdown-preview.nvim",
build = "cd app && yarn install",

View file

@ -1,5 +1,6 @@
-- Package manager for LSP servers, DAP adapters etc.
-- It also handles starting all of my LSP servers
--- @type LazyPluginSpec
return {
"williamboman/mason.nvim",
dependencies = {

View file

@ -1,4 +1,5 @@
-- Library of 30+ independent Lua modules improving overall Neovim
--- @type LazyPluginSpec
return {
"echasnovski/mini.nvim",
version = "*",

View file

@ -1,4 +1,5 @@
-- Formatter plugin
--- @type LazyPluginSpec
return {
"sbdchd/neoformat",
keys = {

View file

@ -1,5 +1,6 @@
-- Replace much of neovim's default UI
-- with a modern replacement
--- @type LazyPluginSpec
return {
"folke/noice.nvim",
event = "VeryLazy",

View file

@ -1,4 +1,5 @@
-- High performance color highlighter
--- @type LazyPluginSpec
return {
"norcalli/nvim-colorizer.lua",
config = true,

View file

@ -1,3 +1,5 @@
-- Debug adapter for NeoVim
--- @type LazyPluginSpec
return {
"mfussenegger/nvim-dap",
config = function()

View file

@ -1,4 +1,5 @@
-- Tree explorer
--- @type LazyPluginSpec
return {
"kyazdani42/nvim-tree.lua",
lazy = false,

View file

@ -1,4 +1,5 @@
-- Make editing passwords safer
--- @type LazyPluginSpec
return {
"https://git.zx2c4.com/password-store",
config = function(plugin)

View file

@ -1,3 +1,5 @@
-- Customize statuscolumn
--- @type LazyPluginSpec
return {
"luukvbaal/statuscol.nvim",
dependencies = {

View file

@ -1,2 +1,3 @@
-- Do stuff as sudo
--- @type LazyPluginSpec
return { "lambdalisue/suda.vim" }

View file

@ -1,3 +1,4 @@
--- @type LazyPluginSpec
return {
"nvim-telescope/telescope.nvim",
dependencies = {

View file

@ -1,14 +1,15 @@
return {
-- Improved syntax highlighting, text objects and more
--- @type LazyPluginSpec
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
init = function(plugin)
init = function()
require("nvim-treesitter.install").update({
with_sync = true,
})
end,
--- @type TSConfig
---@diagnostic disable-next-line: missing-fields
opts = {
highlight = { enable = true },
indent = { enable = true },
@ -91,13 +92,15 @@ return {
config = function()
-- When in diff mode, we want to use the default
-- vim text objects c & C instead of the treesitter ones.
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
--- @type table<string,fun(...)>
local move = require("nvim-treesitter.textobjects.move")
local configs = require("nvim-treesitter.configs")
for name, fn in pairs(move) do
if name:find("goto") == 1 then
move[name] = function(q, ...)
if vim.wo.diff then
local config = configs.get_module("textobjects.move")[name] ---@type table<string,string>
--- @type table<string,string>
local config = configs.get_module("textobjects.move")[name]
for key, query in pairs(config or {}) do
if q == query and key:find("[%]%[][cC]") then
vim.cmd("normal! " .. key)
@ -115,8 +118,9 @@ return {
},
-- Automatically add closing tags for HTML and JSX
--- @type LazyPluginSpec
{
"windwp/nvim-ts-autotag",
opts = {},
config = true,
},
}

View file

@ -1,4 +1,5 @@
-- Better folds
--- @type LazyPluginSpec
return {
"kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" },
@ -8,6 +9,7 @@ return {
"imports",
},
},
--- @param opts UfoConfig
config = function(_, opts)
local ufo = require("ufo")
ufo.setup(opts)

View file

@ -1,6 +1,7 @@
-- Display possible keybinds
-- Here I have also defined some generic keybinds
-- Plugin specific keybinds are set up in plugin configuration file
--- @type LazyPluginSpec
return {
"folke/which-key.nvim",
config = function()