mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-07-29 15:04:36 +02:00
update treesitter
This commit is contained in:
parent
962f03f0e4
commit
bf96bc2942
4 changed files with 93 additions and 47 deletions
lua
|
@ -69,12 +69,36 @@ return {
|
|||
|
||||
-- include treesitter
|
||||
-- require("plugins.treesitter"),
|
||||
-- {
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac",
|
||||
-- run = ":TSUpdate",
|
||||
-- event = "BufWinEnter",
|
||||
-- opts = function()
|
||||
-- require("user.treesitter")
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac",
|
||||
run = ":TSUpdate",
|
||||
event = "BufWinEnter",
|
||||
opts = function()
|
||||
cmd = {
|
||||
"TSBufDisable",
|
||||
"TSBufEnable",
|
||||
"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")
|
||||
end,
|
||||
},
|
||||
|
|
|
@ -1,56 +1,22 @@
|
|||
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
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "css" }, -- list of language that will be disabled
|
||||
enable = true,
|
||||
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,
|
||||
},
|
||||
autotag = { enable = true },
|
||||
incremental_selection = { enable = true },
|
||||
indent = { enable = true, disable = { "python", "css" } },
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
|
56
lua/user/treesitter_20230205.lua
Normal file
56
lua/user/treesitter_20230205.lua
Normal 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,
|
||||
},
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue