HiPhish / nvim-ts-rainbow2

Rainbow delimiters for Neovim through Tree-sitter
https://gitlab.com/HiPhish/nvim-ts-rainbow2
Apache License 2.0
338 stars 35 forks source link

Don't work #20

Closed Bogdan-Torkhov closed 1 year ago

Bogdan-Torkhov commented 1 year ago

These is my treesitter config:

local nvim_treesitter_setup, nvim_treesitter = pcall(require, "nvim-treesitter")
if not nvim_treesitter_setup then
    return
end

local rainbow_setup, rainbow = pcall(require("ts-rainbow"))
if not rainbow_setup then
    return
end

nvim_treesitter.setup({
    ensure_installed = { "all" },
    sync_install = { enable = false },
    highlight = { enable = true },
    indent = { enable = true },
    autotag = { enable = true },
    auto_install = { enable = true },
    rainbow = {
        enable = true,
        query = { "rainbow-parens" },
        strategy = rainbow.strategy.global,
        hlgroups = {
            "TSRainbowBlue",
            "TSRainbowViolet",
            "TSRainbowOrange",
            "TSRainbowGreen",
            "TSRainbowYellow",
            "TSRainbowRed",
            "TSRainbowCyan",
        },
    },
})

and it doesn't work

SylEleuth commented 1 year ago

Does treesitter work at all with that settings? Because it should be "nvim-treesitter.configs" in the first line. Check that link. Also there's something wrong with the pcall(require("ts-rainbow")).

HiPhish commented 1 year ago

Yeah, the imports are wrong. As an aside, you don't need to that many options, you have just set everything to the default value. A simple enable = true is all you need.

Bogdan-Torkhov commented 1 year ago

Yeah, the imports are wrong. As an aside, you don't need to that many options, you have just set everything to the default value. A simple enable = true is all you need.

Worked