7

I have installed syntastic on VIM to help me show errors in PHP code however with the current colorscheme/setting I have to following colors: error line

As you can see it's very hard to read, I wonder if there is a way to change the color if this error window specifically.

Martijn Smidt
  • 1,604
  • 1
  • 10
  • 10
  • To change the Vim Syntastic location list background color you can edit `ctermbg` in `highlight QuickFixLine ctermfg=none ctermbg=none cterm=none` – Brandon Apr 26 '21 at 03:24

2 Answers2

8

If this is only for the current selected item in the quickfix window, that's the Search highlight group on top of the normal quickfix highlighting. You then have to change either one; the Search group will affect search results in other windows, too.

If this is other / special Syntastic highlighting, you best look through all groups in the :hi output to find the bad one.

Overriding

Unless you want to completely switch your colorscheme, you can adapt individual highlight groups via :highlight commands after the :colorscheme command in your ~/.vimrc. Either :hi link to another predefined group, or provide your own ctermfg=... guifg=... etc. color definitions, as described by :help highlight-args.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
4

Syntastic doesn't change (nor cares about) highlighting of the error window. It's a plain quickfix window, with filetype qf. Looking at syntax/qf.vim, the default highlighting is this:

syn match   qfFileName      "^[^|]*" nextgroup=qfSeparator
syn match   qfSeparator     "|" nextgroup=qfLineNr contained
syn match   qfLineNr        "[^|]*" contained contains=qfError
syn match   qfError         "error" contained

hi def link qfFileName      Directory
hi def link qfLineNr        LineNr
hi def link qfError         Error

Thus, if you see the quickfix window in different colours than the main text, it's because your colour scheme has specifically intended it to look that way. You can override highlighting for qfFileName, qfSeparator, qfLineNr, and qfError to make it more readable, but the better solution IMO would be to use a less broken colour scheme.

Edit: Vim 8.0.641 and later has QuickFixLine.

lcd047
  • 5,731
  • 2
  • 28
  • 38