Nvim: add type annotations to plugin opts

This commit is contained in:
Marko Korhonen 2023-11-21 22:28:54 +02:00
parent 26d0dae2fc
commit b5498c671d
9 changed files with 50 additions and 58 deletions

View file

@ -2,6 +2,7 @@ return {
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
version = "*", version = "*",
dependencies = { "kyazdani42/nvim-web-devicons" }, dependencies = { "kyazdani42/nvim-web-devicons" },
---@type BufferlineConfig
opts = { opts = {
options = { options = {
diagnostics = "nvim_lsp", diagnostics = "nvim_lsp",

View file

@ -25,10 +25,6 @@ return {
local cmp = require("cmp") local cmp = require("cmp")
local luasnip = require("luasnip") local luasnip = require("luasnip")
if not cmp then
return
end
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
vim.o.completeopt = "menuone,noselect" vim.o.completeopt = "menuone,noselect"

View file

@ -1,6 +1,7 @@
-- Indent characters -- Indent characters
return { return {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
---@type ibl.config
opts = { opts = {
exclude = { exclude = {
filetypes = { filetypes = {

View file

@ -1,6 +1,7 @@
-- Colorscheme -- Colorscheme
return { return {
"rebelot/kanagawa.nvim", "rebelot/kanagawa.nvim",
---@type KanagawaConfig
opts = { opts = {
compile = true, compile = true,
dimInactive = true, dimInactive = true,

View file

@ -2,8 +2,7 @@
return { return {
"sbdchd/neoformat", "sbdchd/neoformat",
config = function() config = function()
local wk = require("which-key") require("which-key").register({
wk.register({
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" }, f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
}, { prefix = "<leader>" }) }, { prefix = "<leader>" })
end, end,

View file

@ -4,6 +4,7 @@ return {
"folke/noice.nvim", "folke/noice.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" },
---@type NoiceConfig
opts = { opts = {
lsp = { lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter** -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
@ -19,8 +20,7 @@ return {
}, },
}, },
config = function(_, opts) config = function(_, opts)
local noice = require("noice") require("noice").setup(opts)
noice.setup(opts)
require("which-key").register({ require("which-key").register({
d = { d = {

View file

@ -1,7 +1,5 @@
-- High performance color highlighter -- High performance color highlighter
return { return {
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
config = function() config = true,
require("colorizer").setup()
end,
} }

View file

@ -3,50 +3,46 @@ return {
build = function() build = function()
require("nvim-treesitter.install").update({ with_sync = true }) require("nvim-treesitter.install").update({ with_sync = true })
end, end,
config = function() ---@type TSConfig
require("nvim-treesitter.configs").setup({ opts = {
ensure_installed = { ensure_installed = {
"bash", "bash",
"css", "css",
"dockerfile", "dockerfile",
"git_config", "git_config",
"git_rebase", "git_rebase",
"gitattributes", "gitattributes",
"gitcommit", "gitcommit",
"gitignore", "gitignore",
"html", "html",
"http", "http",
"java", "java",
"javascript", "javascript",
"json", "json",
"json5", "json5",
"latex", "latex",
"lua", "lua",
"make", "make",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
"php", "php",
"python", "python",
"rasi", "rasi",
"regex", "regex",
"rst", "rst",
"scss", "scss",
"toml", "toml",
"tsx", "tsx",
"typescript", "typescript",
"vim", "vim",
"yaml", "yaml",
}, },
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
incremental_selection = { enable = true }, incremental_selection = { enable = true },
context_commentstring = { enable = true }, context_commentstring = { enable = true },
sync_install = true, sync_install = true,
ignore_install = {}, ignore_install = {},
auto_install = true, auto_install = true,
}) },
-- vim.wo.foldmethod = 'expr'
-- im.wo.foldexpr = 'nvim_treesitter#foldexpr()'
end,
} }

View file

@ -4,7 +4,7 @@ return {
"folke/which-key.nvim", "folke/which-key.nvim",
config = function() config = function()
local wk = require("which-key") local wk = require("which-key")
wk.setup({}) wk.setup()
wk.register({ wk.register({
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" }, h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },