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-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" },
"nvim-ts-autotag": { "branch": "main", "commit": "aeb7090098722ffce16597bd0331105495640153" }, "nvim-ts-autotag": { "branch": "main", "commit": "aeb7090098722ffce16597bd0331105495640153" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cbab9ad88036915beebd13b47e100743ff2ed2d5" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cbab9ad88036915beebd13b47e100743ff2ed2d5" },
"nvim-ts-rainbow2": { "branch": "master", "commit": "ad0a051b2d398639e60a5f94f24ca629b9af5ab1" },
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" }, "nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },

View file

@ -2,6 +2,11 @@ return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
{
"pojokcodeid/nvim-ts-rainbow2",
lazy = true,
event = "BufRead",
},
{ {
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
lazy = true, lazy = true,
@ -61,18 +66,29 @@ return {
"TSInstallFromGrammar", "TSInstallFromGrammar",
}, },
event = { "BufRead", "VeryLazy" }, event = { "BufRead", "VeryLazy" },
opts = { opts = function()
highlight = { enable = true }, return {
indent = { enable = true }, highlight = { enable = true },
ensure_installed = { indent = { enable = true },
"lua", ensure_installed = {
"vim", "lua",
"vimdoc", "vim",
}, "vimdoc",
incremental_selection = { },
enable = true, 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) config = function(_, opts)
if type(opts.ensure_installed) == "table" then if type(opts.ensure_installed) == "table" then
---@type table<string, boolean> ---@type table<string, boolean>