This commit is contained in:
asep komarudin 2023-01-15 00:57:57 +07:00
parent 1a1483a2d2
commit f1e6c8c266
5 changed files with 85 additions and 20 deletions

56
lua/user/treesitter.lua Normal file
View file

@ -0,0 +1,56 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup({
ensure_installed = {
"bash",
"html",
"c",
"javascript",
"json",
"lua",
"python",
"typescript",
"tsx",
"css",
"rust",
"java",
"yaml",
"markdown",
"markdown_inline",
}, -- one of "all" or a list of languages
ignore_install = { "phpdoc" }, -- List of parsers to ignore installing
highlight = {
enable = true, -- false will disable the whole extension
disable = { "css" }, -- list of language that will be disabled
additional_vim_regex_highlighting = false,
},
autopairs = {
enable = true,
},
indent = { enable = true, disable = { "python", "css" } },
context_commentstring = {
enable = true,
enable_autocmd = false,
config = {
-- Languages that have a single comment style
typescript = "// %s",
css = "/* %s */",
scss = "/* %s */",
html = "<!-- %s -->",
svelte = "<!-- %s -->",
vue = "<!-- %s -->",
json = "",
},
},
autotag = { enable = true },
incremental_selection = { enable = true },
rainbow = {
enable = true,
disable = { "html" },
extended_mode = false,
max_file_lines = nil,
},
})