Wednesday, September 4, 2013

Re: Set different highlighting for Search versus current quickfix error

On Wednesday, September 4, 2013 7:47:25 PM UTC-4, Tony Mechelynck wrote:
> ...if I do :copen first...I see this item as blue on white, and
> doing ":verbose hi qfFileName" in the quickfix window gives
>
> qfFileName xxx links to Directory
> Last set from /usr/local/share/vim/vim74/syntax/qf.vim
>
> The Search highlight, OTOH, is black on yellow. Not at all the same
> thing for me, which makes me ask: Which colorscheme are you using?
>
> To link qfFileName to something else, or to define specific colours
> for it, just use a new or modified colorscheme.
>
> To modify a colorscheme, first copy it to ~/.vim/colors/ (for *x
> systems) or to ~/vimfiles/colors (for Windows), change its name, and
> modify it there (including setting g:colors_name to the new name);
> then alter the calling line so that it calls the new name. It is not
> possible to invoke colorschemes recursively (or at least, I tried
> and didn't succeed).

I have a colorscheme called mine.vim containing lots of highlight commands. Prepended to those commands is the preamble

set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "mine"

I've actually set g:colors_name to "mine" in the course of trying to figure out how it works. It was "blue" before, probably because I never figured out how it worked, and "blue" was a good fallback colorscheme. Reading the help on colors_name and experimenting, it seems that g:colors_name is only used to get back the colorscheme if you haven't toggled the background setting. If you have, g:colors_name is wiped out.

In any case, none of the :hi statements in mine.vim contain the word "Directory", so I added to following to turn on a bit of green:

hi Directory guibg=#00cc00

All this did was to highlight the filename field of all quickfix entries with a green background. The current quickfix item, however, is still highlighted in the Search guibg (red). This means the entire row, not just a single field in the row.

Based on my last post, I suspect that this is hard-coded.

Thanks for tinkering and posting. I think I have a better idea of how color schemes work now.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment