refactor(nvim): use rainbow-delimiters.nvim instead of ts-rainbow2

ts-rainbow2 is deprecated 😔
This commit is contained in:
Price Hiller 2023-07-13 14:22:07 -05:00
parent ecfc5c6330
commit 005c9b0ba7
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8
2 changed files with 38 additions and 21 deletions

View File

@ -42,26 +42,6 @@ nvim_treesitter.setup({
enable = true, enable = true,
}, },
indent = { enable = true }, indent = { enable = true },
rainbow = {
enable = true,
query = {
"rainbow-parens",
html = "rainbow-tags",
latex = "rainbow-blocks",
tsx = "rainbow-tags",
vue = "rainbow-tags",
javascript = "rainbow-parens-react",
},
strategy = {
on_attach = function()
if vim.fn.line("$") < 1000 then
require("ts-rainbow.strategy.local")
elseif vim.fn.line("$") < 10000 then
require("ts-rainbow.strategy.global")
end
end,
},
},
textobjects = { textobjects = {
select = { select = {
enable = true, enable = true,

View File

@ -90,7 +90,6 @@ lazy.setup({
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
dependencies = { dependencies = {
{ url = "https://gitlab.com/HiPhish/nvim-ts-rainbow2.git" },
"nvim-treesitter/nvim-treesitter-context", "nvim-treesitter/nvim-treesitter-context",
"nvim-treesitter/playground", "nvim-treesitter/playground",
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
@ -102,6 +101,44 @@ lazy.setup({
end, end,
}, },
-- Rainbow braces/brackets/etc
{
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
config = function()
local rainbow_delimiters = require("rainbow-delimiters")
vim.g.rainbow_delimiters = {
strategy = {
on_attach = function()
if vim.fn.line("$") > 10000 then
return nil
elseif vim.fn.line("$") > 1000 then
return rainbow_delimiters.strategy["global"]
end
return rainbow_delimiters.strategy["local"]
end,
},
query = {
[""] = "rainbow-delimiters",
lua = "rainbow-blocks",
latex = "rainbow-blocks",
html = "rainbow-blocks",
javascript = "rainbow-delimiters-react",
tsx = "rainbow-parens",
verilog = "rainbow-blocks",
},
highlight = {
"RainbowDelimiterRed",
"RainbowDelimiterYellow",
"RainbowDelimiterBlue",
"RainbowDelimiterOrange",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterCyan",
},
}
end,
},
-- Dashboard when no file is given to nvim -- Dashboard when no file is given to nvim
{ {
"goolord/alpha-nvim", "goolord/alpha-nvim",