Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim - change highlight of current quickfix line. (QuickFixLine)

Tags:

highlight

vim

How to I change the highlighting of QuickFixLine, so that it has multiple highlights in one single line? For example:

Instead of highlighting the whole line like this: Quickfix window with currently highlighted line

Change the foreground of the quickfix highlight to this: How I would like it to be

How can I make this happen?

like image 224
DasOhmoff San Avatar asked Sep 16 '25 01:09

DasOhmoff San


1 Answers

You can't really create multiple highlightings on the same line with QuickFixLine, in the general case.

However, QuickFixLine is applied on top of the highlighting that already exists in the quickfix window (which is defined by syntax rules.)

So, as long as you're not touching the particular attributes assigned by syntax rules (in this case, the foreground color) and you're only touching the other attributes (in this case, background color and setting text bold), you can achieve exactly the effect you're after.

For instance, applying this command should achieve the effect you're after:

:hi QuickFixLine ctermfg=NONE cterm=bold guifg=NONE gui=bold

You can make that permanent by adding a rule to your vimrc to apply that change after a colorscheme change, with:

augroup vimrc_colors
  au!
  au ColorScheme * hi QuickFixLine ctermfg=NONE cterm=bold guifg=NONE gui=bold
augroup END

It seems you're using a custom theme already, so you might want to consider modifying it to not set a foreground color and to set a bold attribute instead:

hi QuickFixLine
   \ ctermbg=180 cterm=bold
   \ guibg=#334659 gui=bold
like image 122
filbranden Avatar answered Sep 19 '25 15:09

filbranden