I configured my CursorLine to be lightyellow.

cursorline screenshot

I have a couple of issues here:

  • First, lightyellow is marked as an error when it is a valid color. How can I avoid this?
  • Second, when the cursor line is over an error, the error background color disappears and it is really hard to read the text. Is there any way of preventing this behavior?

screenshot cursor line error

  • Maybe set both ctermgb and ctermfg to something other than none ? Example: vim.wikia.com/wiki/Highlight_current_line
    – VanLaser
    Mar 10 '16 at 13:39
  • If I add ctermfg all the text in the line will be coloured in the color specified. So, I will lose the syntax highlight in that line, and I don't want it.
    – jherran
    Mar 10 '16 at 13:47
  1. The default syntax script for vim doesn't have lightyellow listed for vimHiCtermColor. You could patch it and submit your change to the vim_dev mailing list.

    Or, better, ask them if that is intentional.

  2. Error as a lower priority than CursorLine but you can force it with this simple hack:

    hi Error cterm=reverse ctermbg=white ctermfg=red

    Instead of white text on red background, you use red text on white background and reverse them with the reverse attribute:

    • it gives you white on red,
    • it increases the priority of Error.

If you're using the GUI:

hi Error gui=reverse guibg=White guifg=Red

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.