2

My colour scheme (morning) doesn't play nice with the quickfix window: I cannot read the selected item's location, because the foreground and background colours are the same. Because of this I want to redefine some highlighting styles, e.g. for Search and LineNr. However, I only want to do this in the quickfix window.

When I edit ~/.vim/syntax/qf.vim with my changes, this affects also highlighting in other syntaxes. How can I change highlighting styles for one syntax only? I'm using, for example:

hi Search ctermbg=white
0

You can use auto commands and put them in ~/.vimrc.

au QuickFixCmdPre * hi Search ctermbg=white

This command will set ctermbg color as White before entering quickfix.

  • This doesn't seem to work. I'm using syntastic, maybe that matters? – user2598 May 31 '16 at 5:57
  • Can you give :verbose hi Search in command line? So that we can check whether the color is changed by syntactic or any other plugin? – SibiCoder May 31 '16 at 6:26
  • It says Last set from /usr/share/vim/vim74/colors/morning.vim; the command doesn't seem to be called at all. – user2598 May 31 '16 at 11:39
  • Can you put the auto command line in a plugin inside after directory? This plugin may be created like /home/username/.vim/after/plugin/pluginname.vim if you don't have this yet. That might work. – SibiCoder May 31 '16 at 12:10
  • I tried, but the result is the same, unfortunately. – user2598 May 31 '16 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy