How to change Vi editor background

6

3

I am connecting through putty and i am using vim editor in putty and writing program in perl. I dont have any particular vimrc file.

My problem is that in vim comments are rendered in DARK BLUE on BLACK BACKGROUND.

How to change that comments into some light color in vim or change some settings in putty?

Tree

Posted 2010-06-24T09:22:57.967

Reputation: 357

Answers

6

you can either

  • play around with
:set background=dark
:set background=light
  • or use another colorscheme:
:colorscheme tab
  • or change the coloring for a 'comment' in your current colorscheme with
:highlight Comment

(this shows you the current settings, change it via

:highlight Comment guibg=white

or to whatever color you want.

akira

Posted 2010-06-24T09:22:57.967

Reputation: 52 754

How can I save these settings? – Dean Rather – 2012-04-20T00:55:18.463

@Dean: store them in your .vimrc, read more about it http://vimdoc.sourceforge.net/htmldoc/usr_05.html

– akira – 2012-04-20T06:01:55.257

4

You can say the following in vim:

:set background=dark

This will set the syntax highlighting to bright colours. The opposite will set it to dark colours:

:set background=light

petersohn

Posted 2010-06-24T09:22:57.967

Reputation: 2 554

3

Instead of (or in addition to) changing the colors in vim (as suggested in the other answers), you can also configure PuTTY to use colors that are easier to distinguish. PuTTY's color settings are under "Window/Colours". You probably want to change "ANSI blue" and "ANSI blue bold" to be lighter/brighter.

The advantage is that this will affect display in all programs that use color (such as ls --color or grep --color) and for all systems you log into.

sleske

Posted 2010-06-24T09:22:57.967

Reputation: 19 887

1

See /usr/share/vim/vim61/colors/README.txt where /usr/share/vim/vim61/ is your vim directory. /usr/share/vim/vim61/colors/ holds all themes and configures the highlighting colors used.

BloodPhilia

Posted 2010-06-24T09:22:57.967

Reputation: 27 374

1

You can try to edit the c.vim / cpp.vim file There is a variety of statement like:

  hi Comment       gui=NONE guifg=#0000ff

just change #0000ff to e.g. #999999 (a slightly dark gray)

bubu

Posted 2010-06-24T09:22:57.967

Reputation: 9 283