update treesitter

This commit is contained in:
asep komarudin 2023-02-05 01:44:41 +07:00
parent 962f03f0e4
commit bf96bc2942
4 changed files with 93 additions and 47 deletions

View file

@ -35,7 +35,7 @@
"nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" }, "nvim-notify": { "branch": "master", "commit": "bdd647f61a05c9b8a57c83b78341a0690e9c29d7" },
"nvim-scrollview": { "branch": "main", "commit": "ba6c48bf7919dd48a371e7b9c683b8858053e885" }, "nvim-scrollview": { "branch": "main", "commit": "ba6c48bf7919dd48a371e7b9c683b8858053e885" },
"nvim-tree.lua": { "branch": "master", "commit": "7eb33d2a6d5d574a43159da90e0eac2445367393" }, "nvim-tree.lua": { "branch": "master", "commit": "7eb33d2a6d5d574a43159da90e0eac2445367393" },
"nvim-treesitter": { "branch": "master", "commit": "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac" }, "nvim-treesitter": { "branch": "master", "commit": "69388e84c34d40c3d5c7d2f310db13276f2179e1" },
"nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-web-devicons": { "branch": "master", "commit": "2b96193abe4372e18e4f4533895a42a466d53c17" }, "nvim-web-devicons": { "branch": "master", "commit": "2b96193abe4372e18e4f4533895a42a466d53c17" },

View file

@ -69,12 +69,36 @@ return {
-- include treesitter -- include treesitter
-- require("plugins.treesitter"), -- require("plugins.treesitter"),
-- {
-- "nvim-treesitter/nvim-treesitter",
-- commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac",
-- run = ":TSUpdate",
-- event = "BufWinEnter",
-- opts = function()
-- require("user.treesitter")
-- end,
-- },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac", cmd = {
run = ":TSUpdate", "TSBufDisable",
event = "BufWinEnter", "TSBufEnable",
opts = function() "TSBufToggle",
"TSDisable",
"TSEnable",
"TSToggle",
"TSInstall",
"TSInstallInfo",
"TSInstallSync",
"TSModuleInfo",
"TSUninstall",
"TSUpdate",
"TSUpdateSync",
},
build = function()
require("nvim-treesitter.install").update({ with_sync = true })()
end,
config = function()
require("user.treesitter") require("user.treesitter")
end, end,
}, },

View file

@ -1,56 +1,22 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs") require("nvim-treesitter.configs").setup({
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 = { highlight = {
enable = true, -- false will disable the whole extension enable = true,
disable = { "css" }, -- list of language that will be disabled
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
autopairs = {
enable = true,
},
indent = { enable = true, disable = { "python", "css" } },
context_commentstring = { context_commentstring = {
enable = true, enable = true,
enable_autocmd = false, 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 = { rainbow = {
enable = true, enable = true,
disable = { "html" }, disable = { "html" },
extended_mode = false, extended_mode = false,
max_file_lines = nil, max_file_lines = nil,
}, },
autotag = { enable = true },
incremental_selection = { enable = true },
indent = { enable = true, disable = { "python", "css" } },
autopairs = {
enable = true,
},
}) })

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,
},
})