-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin assumes RGB colors => does not support cterm colors (from 256 color palette) #36
Comments
you can use 256 color names (i.e https://www.ditig.com/256-colors-cheat-sheet) {
provider = 'AbraCadabra!',
hl = { fg = "LightGoldenrod1", bg = "CornflowerBlue"}
} |
I see, I thought you only needed a convenient way to indicate 8 bit colors. I'll think about it. |
Thanks a lot! I tried using this: require"heirline".setup({
{ provider = "before " },
{
provider = "%f",
hl = { cterm = {italic = true}, ctermfg = 123 },
},
{ provider = " after" },
}) 👉 I'd have expected to not have any background colors, and have the same default white everywher. I'm not sure if the behavior is intended or not.. is it because statusline highlights need to always have a background? |
It's not they need, it's just the way vim handles highlights, if you don't provide a background color you won't have one. Commonly, one wants some default colors tho, here's an example. All highlights will be recursively merged, so foreground will be overwritten, but if no background is provided, the default one will be used. require"heirline".setup({
hl = function()
if conditions.is_active() then
return "StatusLine"
else
return "StatusLineNC"
end
end,
{ provider = "before " },
{
provider = "%f",
hl = { cterm = {italic = true}, ctermfg = 123 },
},
{ provider = " after" },
}) |
Makes sense! As for the weird black background, it was actually an issue with my theme.. I really have no idea why I had soo many Thanks a lot again for the examples and the plugin, it's great \o/ |
Hello!
I'm in the process of converting my old nvim config to Lua, and rewriting most of my config.
I've chosen heirline for the statusline, I love what you did with it!
I noticed that the highlighting system assume we're using RGB colors, but in my case I want to only use colors from the 256 color palette.
>>> preview of the available colors, from 0 to 255 <<<
(this palette has been generated using https://github.com/guns/xterm-color-table.vim)
I actually prefer using these than using RGB colors, because 256 colors are largely enough for me, and RGB actually give to much choice for my taste..
FYI highlights in 256 color mode are given using
ctermfg
,ctermbg
andcterm
(for the style)Read more at
:h highlight-args
I quickly looked at your code, the highlight is created here:
heirline.nvim/lua/heirline/highlights.lua
Line 14 in eab43b3
that function does accept
cterm*
params.I tested this:
and the output is:
![image](https://user-images.githubusercontent.com/9730330/172062102-fd104c95-217b-4774-b003-91684d7d53b5.png)
👉 I think the simplest implementation in heirline would be to accept (and merge them as necessary) the new fields
cterm
,ctermbg
&ctermfg
in thehl
component property.(the implementation of
name_hl
would also need to take this into account)What do you think ?
The text was updated successfully, but these errors were encountered: