add: update config support ts ts rainbow

This commit is contained in:
asep.komarudin 2024-05-19 21:50:27 +07:00
parent 82ab2d8832
commit 222154cce9
2 changed files with 29 additions and 12 deletions

View file

@ -41,6 +41,7 @@
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" },
"nvim-ts-autotag": { "branch": "main", "commit": "aeb7090098722ffce16597bd0331105495640153" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cbab9ad88036915beebd13b47e100743ff2ed2d5" },
"nvim-ts-rainbow2": { "branch": "master", "commit": "ad0a051b2d398639e60a5f94f24ca629b9af5ab1" },
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },

View file

@ -2,6 +2,11 @@ return {
{
"nvim-treesitter/nvim-treesitter",
dependencies = {
{
"pojokcodeid/nvim-ts-rainbow2",
lazy = true,
event = "BufRead",
},
{
"JoosepAlviste/nvim-ts-context-commentstring",
lazy = true,
@ -61,7 +66,8 @@ return {
"TSInstallFromGrammar",
},
event = { "BufRead", "VeryLazy" },
opts = {
opts = function()
return {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
@ -72,7 +78,17 @@ return {
incremental_selection = {
enable = true,
},
autopairs = {
enable = true,
},
rainbow = {
enable = true,
disable = { "html", "tsx" },
equery = "rainbow-parens",
strategy = require("ts-rainbow").strategy.global,
},
}
end,
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
---@type table<string, boolean>