Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing vim cursor column color to something else than vim background?

Tags:

vim

macvim

How can I make the vim column (:set cursor column) to be of a different color? This is what I see now:

enter image description here

Notice that the column color is of the same color that vim is using to mark my identation, etc (which I think is the background color). I would like to pick a different color.

Cheers :)

like image 680
Goles Avatar asked Feb 16 '12 13:02

Goles


2 Answers

Use this:

:highlight CursorColumn guibg=#404040

See :help hl-CursorColumn (to which :help 'cursorcolumn' redirected)

like image 65
Benoit Avatar answered Sep 21 '22 08:09

Benoit


If the cursorcolumn does not appear to be working as expected it could be because the cursor column color is too close to your background theme color. Try these steps to resolve this:

  • If you are using certain backgrounds (maybe a dark background for example) change the color of the column using something like :highlight CursorColumn guibg=#ff0000 for the gui version of vim. If you are not using the gui version of vim try this :highlight CursorColumn ctermbg=Grey

  • Make sure you are using version 6.3 or later of vim. This feature was not available before that time. If you are on an OS like CentOS or Red Hat that does not have a current version of vim you can compile it.

  • Make sure your vim is compiled with +syntax

like image 20
SnapShot Avatar answered Sep 21 '22 08:09

SnapShot