diff --git a/lazy-lock.json b/lazy-lock.json index d7802eb..51cdd0f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -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" }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index b50f404..938281f 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -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,18 +66,29 @@ return { "TSInstallFromGrammar", }, event = { "BufRead", "VeryLazy" }, - opts = { - highlight = { enable = true }, - indent = { enable = true }, - ensure_installed = { - "lua", - "vim", - "vimdoc", - }, - incremental_selection = { - enable = true, - }, - }, + opts = function() + return { + highlight = { enable = true }, + indent = { enable = true }, + ensure_installed = { + "lua", + "vim", + "vimdoc", + }, + 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