Fix treesitter config module name for current nvim-treesitter
This commit is contained in:
@@ -3,9 +3,21 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate", -- Installs and updates parsers
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all"
|
||||
|
||||
config = function()
|
||||
local ok, ts = pcall(require, "nvim-treesitter.config")
|
||||
if not ok then
|
||||
ok, ts = pcall(require, "nvim-treesitter.configs")
|
||||
end
|
||||
if not ok then
|
||||
vim.notify(
|
||||
"nvim-treesitter: config module not found",
|
||||
vim.log.levels.ERROR
|
||||
)
|
||||
return
|
||||
end
|
||||
|
||||
ts.setup({
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"cpp",
|
||||
@@ -21,16 +33,10 @@ return {
|
||||
"json",
|
||||
"php",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied on startup)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = { enable = true },
|
||||
})
|
||||
end,
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user