Vim Customize Room Color

I am looking for a way to adjust the color used for line numbering (as in :set nu ) in Vim. The default value on most platforms appears yellow (which is also used for some highlighted tokens). I would like to color the line numbers dull gray; somewhere in neighborhood #555 . I'm not picky, although any muted color would be acceptable.

+56
vim syntax-highlighting configuration
Oct 26 '08 at 0:52
source share
4 answers

Try:

 help hl-LineNr 

I found this via:

 help 'number' 

which is a way to get help on the 'number' option instead of the :number command.

To really change the displayed color:

 :highlight LineNr ctermfg=grey 

This will change the foreground color for LineNr on the character terminal to gray. If you are using gVim, you can:

 :highlight LineNr guifg=#050505 
+91
Oct 26 '08 at 0:55
source share

To change line numbers, be sure to add them below to .vimrc

highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE

Of course, you change ctermfg and guifg to whatever color you want.

+11
Aug 20 '15 at 20:53 on
source share

On MacVim (with Vim 7.3 on it, the kernel) I found CursorLineNr to work:

hi CursorLineNr guifg=#050505

+9
Sep 10
source share

I did not like the colors highlighted by the selected color scheme, so I changed the color of the line numbers as follows:

 colorscheme trivial256 " for light background hi LineNr term=bold cterm=bold ctermfg=2 guifg=Grey guibg=Grey90 
+1
May 8 '16 at 17:45
source share



All Articles