Closed xy9485 closed 2 years ago
Yes, the first colour is red. You can change it - https://github.com/p00f/nvim-ts-rainbow#installation-and-setup
red which looks not so neat
I just picked a set of colours from gruvbox, the user is expected to change it/use a colorscheme which changes it
I just picked a set of colours from gruvbox, the user is expected to change it/use a colorscheme which changes it
Thanks for the reply. So just changing colorschemes can also change the default order of rainbow colors?
Since I'm a newbie to this plugin, I'm also not sure what's the format for the content to change the color setting below(e.g. change the order of default availible colors). Could you provide an small example?
require'nvim-treesitter.configs'.setup{
rainbow = {
-- Setting colors
colors = {
-- Colors here
},
-- Term colors
termcolors = {
-- Term colors here
}
},
}
So just changing colorschemes can also change the default order of rainbow colors?
Some colorschemes support this plugin - https://sr.ht/~novakane/kosmikoa.nvim/, https://github.com/ishan9299/modus-theme-vim etc
I wonder if it works when only modifying termcolors
and leaving colors
commented?
Actually I tried both by changing the order, didn't change colors of brackets. Would colorschemes force the order of color?
Termcolors is for terminal vim without guicolors - ie tty. You don't need that in modern terminals
Actually I tried both by changing the order, didn't change colors of brackets. Would colorschemes force the order of color?
paste your config please
Termcolors is for terminal vim without guicolors - ie tty. You don't need that in modern terminals
Actually I tried both by changing the order, didn't change colors of brackets. Would colorschemes force the order of color?
paste your config please
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup {
ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
ignore_install = { "" }, -- List of parsers to ignore installing
autopairs = {
enable = true,
},
highlight = {
enable = true, -- false will disable the whole extension
disable = { "" }, -- list of language that will be disabled
additional_vim_regex_highlighting = true,
},
indent = { enable = true, disable = { "yaml" } },
context_commentstring = {
enable = true,
enable_autocmd = false,
},
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
colors = {
"#a89984",
"#cc241d",
"#b16286",
"#d79921",
"#689d6a",
"#d65d0e",
"#458588",
}, -- table of hex strings
-- termcolors = {
-- "Red",
-- "Green",
-- "Yellow",
-- "Blue",
-- "Magenta",
-- "Cyan",
-- "White",
-- }, -- table of colour name strings
}
}
for example I wanted to make green as the first choice, didn't work out. I use onedarkpro colorscheme which support many plugins including nvim-ts-rainbow Update: I paste the full setting of treesitter
https://github.com/olimorris/onedarkpro.nvim this? You can disable onedark highlighting using this https://github.com/olimorris/onedarkpro.nvim#configuring-plugins
This is the only way out, if I drop default
https://github.com/p00f/nvim-ts-rainbow/blob/a62dc50becf8b0fb4348fe02029b49247f9f3db7/lua/rainbow/internal.lua#L138 here then users won't be able to manually override using hi rainbowcol1..
Yes, correct link. I might not fully understand, to disable onedark highlighting by configuring onedarkpro's plugin support? Can you explain more detailed? Does this operation independently solve the problem on your side, or is that change in internal.lua
additionally needed? Honestly I prefer not to touch internal code since I don't want to make it ad-hoc.
Btw, can I just use this hi rainbowcol1 guifg=#123456
to change the order of colors?
I might not fully understand, to disable onedark highlighting by configuring onedarkpro's plugin support?
yes
you dont need to touch internal.lua, just set the colors in your config: https://github.com/p00f/nvim-ts-rainbow#colours
You can disable onedark highlighting using this https://github.com/olimorris/onedarkpro.nvim#configuring-plugins
Sorry for my confussion on this point, I assume you refer to disabling nvim-ts-rainbow in onedarkpro's plugin configuration, is that correct?
yes
So I disabled nvim-ts-rainbow in oneardkpro, it does make some changes, but still doesn't match the order. For example with the config you gave before:
colors = {
"#cc241d", --red
"#a89984", --grey
"#b16286", --Magenta
"#d79921", --yellow
"#689d6a", --green
"#d65d0e", --orange
"#458588", --cyan
},
And looks like the color order remains same if I change the order in config:
colors = {
"#a89984", --grey
"#cc241d", --red
"#b16286", --Magenta
"#d79921", --yellow
"#689d6a", --green
"#d65d0e", --orange
"#458588", --cyan
},
the colours in the picture look like onedark, not gruvbox. are you sure you did
require("onedarkpro").setup({
plugins = {nvim_ts_rainbow = false}
})
Oh my bad, I did mistype onedark when requiring. Now it works, many thanks!!
The default color of bracket or the first layer of nested brackets is red which looks not so neat, as show in the screenshot. I find it's different with the color effect I've seen in some videos. Did I miss somewhere in config?