cap153_nvim/lua/lazy/plugins/treesitter.lua
2024-10-07 15:29:32 +08:00

40 lines
1.2 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ===
-- === treesitter,语法高亮
-- ===
return {
'nvim-treesitter/nvim-treesitter',
config = function()
-- 要安装高亮的语言直接加入括号即可把sync_install设置为true下次进入vim自动安装语言列表查看treesitter的github
-- 或者执行:TSInstall <language_to_install>
local language = {
"python",
"lua",
"dart",
"markdown",
"go",
"bash",
"java",
"sql",
}
require("nvim-treesitter.configs").setup {
-- A list of parser names, or "all"
ensure_installed = language,
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- List of parsers to ignore installing (for "all")
ignore_install = {},
highlight = {
enable = true,
-- list of language that will be disabled
disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
end
}