Nvim: add type annotations to plugin opts

This commit is contained in:
Marko Korhonen 2023-11-21 22:28:54 +02:00
parent b3ebda5b51
commit 83cd0a7540
No known key found for this signature in database
GPG Key ID: A7F78BCB859CD890
9 changed files with 50 additions and 58 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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