Search code examples
vimcolorsvi

How to change color of space in vim


How can i change the space color in vim. Right now, the space is gray and the color of . is somewhat grayish, so it is hard to identify what is . and space.


Solution

    • Vim usually does not highlight common text with a background color.
    • If you have problems distinguishing punctuation, change / adapt your colorscheme and/or font.
    • There is :set list, which emphasizes whitespace, tabs, etc. Temporarily enabling this helps with whitespace issues, but I would not recommend to keep this on all the time. It's not a proper fix of your problem.

    To solve your highlighting problem: You need to find out which syntax group causes the highlighting. :syn list shows all active groups, but it's easier when you install the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin. (I maintain an extended fork.) When you have the name of the offending syntax group, you can investigate where it comes from; (the last lines of) :scriptnames may help.