mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-18 01:34:32 +02:00
refactor(plugins)!: plugins now use lazy.nvim's new opts
property to make it far easier to override options
This commit is contained in:
parent
8667b3d54e
commit
2135bc144c
8 changed files with 140 additions and 95 deletions
|
@ -3,31 +3,36 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = "BufReadPost",
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"help",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
---@type TSConfig
|
||||
opts = {
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"help",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
config = function(plugin)
|
||||
require("nvim-treesitter.configs").setup({
|
||||
sync_install = false,
|
||||
ensure_installed = plugin.ensure_installed,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
})
|
||||
---@param opts TSConfig
|
||||
config = function(plugin, opts)
|
||||
if plugin.ensure_installed then
|
||||
require("lazyvim.util").deprecate("treesitter.ensure_installed", "treesitter.opts.ensure_installed")
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue