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

Search and IncSearch have same highlight colors in vim #21

Open
alexanderjeurissen opened this issue Jan 18, 2017 · 3 comments
Open

Search and IncSearch have same highlight colors in vim #21

alexanderjeurissen opened this issue Jan 18, 2017 · 3 comments
Assignees

Comments

@alexanderjeurissen
Copy link
Contributor

alexanderjeurissen commented Jan 18, 2017

doing an incremental search for a string or having search highlighting on and doing a search and replace in vim is really cumbersome due to current highlighting colors being used.

when you invoke search in vim all matches for the search pattern are highlighted, then the currently active match is usually highlighted in a different color. In OneHalf however this is not the case:
screen shot 2017-01-18 at 21 13 31
screen shot 2017-01-18 at 21 13 21

This results in the following behaviour:
screen shot 2017-01-18 at 21 20 39
here we can't determine what highlighted instance would be replaced if I press yes.

The next screenshot shows what the behaviour is if IncSearch has a different highlighting then default Search:
screen shot 2017-01-18 at 21 29 10

In this case I simply hijack the highlighting groups that are defined in the onehalf colorscheme file by linking Search to Pmenu and IncSearch to PMenuSel.
like this:

    hi! link Search PMenu
    hi! link IncSearch PMenuSel

as you can see the current active item is highlighted with a blue background and the others are highlighted with gray.

This is just a hack in my own vim configuration file however, I'm not sure what colors we want to use here. Just putting this out to see how we can fix this.

@sonph
Copy link
Owner

sonph commented Jan 19, 2017

Indeed fixing this issue is just a matter of changing two lines for Search and IncSearch. As for the colors I originally wanted to keep the yellow as they pop more on the screen.

From the top of my head maybe we can try

  • white/blue for dark and black/blue for light
  • yellow/red
  • yellow/blue
  • ??

Chrome uses yellow and orange for search highlighting so maybe yellow/red will be a good combination?

@sonph
Copy link
Owner

sonph commented Jan 19, 2017

To test the colors in onehalfdark.vim and onehalflight.vim just replace these lines

call s:h("IncSearch", s:bg, s:yellow, "")
call s:h("Search", s:bg, s:yellow, "")

with

call s:h("IncSearch", s:bg, s:red, "")
call s:h("Search", s:bg, s:yellow, "")

@sonph sonph self-assigned this Feb 9, 2017
@SevereOverfl0w
Copy link

Yellow/red sounds good, even if change our mind later, it's better to be functional for the time being.

SevereOverfl0w added a commit to SevereOverfl0w/.files that referenced this issue Oct 4, 2019
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

No branches or pull requests

3 participants