Skip to content
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

Added an option to use guisp as guifg for terminal users #50

Merged
merged 2 commits into from
Jul 5, 2015
Merged

Added an option to use guisp as guifg for terminal users #50

merged 2 commits into from
Jul 5, 2015

Conversation

amfl
Copy link

@amfl amfl commented Feb 21, 2015

People in the console can't see guisp colors, and therefore can't tell the difference between different kinds of spelling errors.

This commit adds a workaround; a g:gruvbox_guisp_as_guifg variable which allows the guisp color to override the guifg color, so the entire word changes color instead of just the underline.

before
after

@morhetz
Copy link
Owner

morhetz commented Feb 21, 2015

Damn, that's hot. Let me test this for a little bit, I'm definitely gonna merge your PR

@amfl
Copy link
Author

amfl commented Feb 21, 2015

Awesome. :)

Just realized this will change it when NOT in the console as well though, maybe we don't want to be setting guifg at all, just ctermfg...

@amfl
Copy link
Author

amfl commented May 29, 2015

I revisited this again recently :)

  • Crushed into a single commit, rebased to head
  • Changed the config option name (again) to g:gruvbox_foreground_guisp
  • Setting this will ALWAYS use the guisp color as foreground color, regardless of whether the gui is running

An example use case might be something like this in .vimrc:

if has('gui_running')
    let g:gruvbox_foreground_guisp=1
endif

Seems to work correctly, except on the current cursor line with :set cursorline. However, other parts of gruvbox have issues with cursorline as well (See #40, #62.)

What are your opinions on this?

@ysheng26
Copy link

Just saw this after I posted #65

Really like this change:) but how about making the entire mis spell word's color more like jellybeans?

@amfl
Copy link
Author

amfl commented Jun 17, 2015

Hmm, maybe g:gruvbox_foreground_guisp could be replaced with something like

let g:gruvbox_guisp_fallback="bg"

so users could choose foreground or background to compensate for the lack of guisp...

@ysheng26
Copy link

Wow!, thanks! I'll try it out.

@ysheng26
Copy link

I got let g:gruvbox_guisp_fallback="bg" in my vimrc, it works well but different spelling errors don't show different colors, all colors are blue, even if I set let g:gruvbox_guisp_fallback="fg"

@amfl
Copy link
Author

amfl commented Jun 18, 2015

Have you set a spelling localization? I don't think you will get a spelling error on color/colour with "en", for example, you have to set "en_us" or similar. Also try rare words, which should be purple - A good word to test this with is "vim".

@ysheng26
Copy link

I do have spelllang set as en now, but I can get spelling error colors in jellybeans or molokai

@amfl
Copy link
Author

amfl commented Jun 18, 2015

Works fine for me :) Do you get different color errors in gvim with gruvbox when not on this branch?

Imo it doesn't look great though, the guisp color is too light to be used as a background.

@amfl
Copy link
Author

amfl commented Jun 20, 2015

Re: Cursorline glitches discussed above:

According to SO, "cursorline highlighting has priority over the syntax highlighting (spell errors belong to that), and that cannot be changed."

@ysheng26
Copy link

Yes I do get different colors in macvim on the main branch.

morhetz added a commit that referenced this pull request Jul 5, 2015
Added an option to use guisp as guifg for terminal users
@morhetz morhetz merged commit 273c030 into morhetz:master Jul 5, 2015
@morhetz
Copy link
Owner

morhetz commented Jul 5, 2015

Thanks, merged

@morhetz
Copy link
Owner

morhetz commented Jul 5, 2015

@shengyun
could you reproduce this with currently merged PR, running vim and then setting e.g.:

set ft=markdown
set spell
set spelllang=en_us
let g:gruvbox_guisp_fallback='fg'
colo gruvbox

http://take.ms/dbyX7

@ysheng26
Copy link

ysheng26 commented Jul 5, 2015

@morhetz the colors are exactly the same in terminal and macvim. Thanks:)

Guzzii pushed a commit to Guzzii/gruvbox that referenced this pull request Nov 15, 2019
This allows vim to guess the value of &background. This will set the
best colors based on system configuration. This will especially help
while using 16 colors: see morhetz#50

This disables the fix for morhetz#7 temporarily while entering
vim. It should still be possible to switch to and from light and dark
mode afterwards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants