2022-11-25 12:03:22 +08:00
|
|
|
local status, treesitter = pcall(require, "nvim-treesitter.configs")
|
|
|
|
if not status then
|
|
|
|
vim.notify("没有找到 nvim-treesitter")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
treesitter.setup({
|
2022-11-23 13:16:46 +08:00
|
|
|
-- 安装 language parser
|
|
|
|
-- :TSInstallInfo 命令查看支持的语言
|
2022-11-25 12:03:22 +08:00
|
|
|
ensure_installed = { "cpp", "c", "json", "html", "css", "vim", "lua", "javascript", "typescript", "tsx" },
|
|
|
|
-- 启用代码高亮模块
|
2022-11-23 13:16:46 +08:00
|
|
|
highlight = {
|
|
|
|
enable = true,
|
2022-11-25 12:03:22 +08:00
|
|
|
additional_vim_regex_highlighting = false,
|
2022-11-23 13:16:46 +08:00
|
|
|
},
|
2022-11-25 12:03:22 +08:00
|
|
|
})
|