junegunn / limelight.vim

:flashlight: All the world's indeed a stage and we are merely players

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting background color (for solarized-light)

jonathansick opened this issue · comments

Hi— I'm trying out limelight with the solarized-light colour scheme. Limelight seems to be having difficulty calculating the colors. I've set the foreground color,

let g:limelight_conceal_ctermfg = 241

but I still get a "Cannot calculate background color" error. Is there an equivalent option to set the background color? I couldn't see it.

Thanks for your plugin development work; I really appreciate it!

You're using terminal vim, right?

Yeah. I'm in an iTerm2 on the Mac. My iTerm's color scheme is also solarized's since that's their hack to get precise colours in a 256 color palette.

I suppose it only happens when you pass an argument to Limelight command. Bare :Limelight should work as expected. That's because the foreground and background colors of solarized are not in the grayscale spectrum of 256 ANSI colors, and limelight fails to calculate the color with the given coefficient. If the argument is not given, limelight will simply use g:limelight_conceal_ctermfg as the foreground color in the surrounding paragraphs. I guess the error message and the documention needs some improvements.

Ah I see now; so g:limelight_conceal_ctermfg is more a manual override for what color the concealed paragraphs should have (exclusive to using let g:limelight_default_coefficient = 0.3 or something and letting Limelight calculate the concealed color).

In case anyone else runs into this, and is using solarized light, I've got Limelight working nicely by putting this in my vimrc:

let g:limelight_conceal_ctermfg = 245  " Solarized Base1
let g:limelight_conceal_guifg = '#8a8a8a'  " Solarized Base1

It makes for a subtle Limelight effect. If you want something more rather dramatic, then Solarized Base2 is what you want (XTERM 254; Hex #eee8d5).

Thanks @junegunn!

Nice summary! 👍