Bill Hollingsworth wrote:
Hi,
I recently upgraded to VIM 7.0 and now the color settings for my PERL programs
are different. I liked the way the colors were before.
Could someone tell me how to return to the old settings, or how to set the
colors myself?
For instance, now comments and variable names are the same color.
Thanks and best wishes,
Bill Hollingsworth
University of Cambridge Computer Laboratory
I guess the easiest way is to write your own colorscheme. For instance I
use the attached colorscheme which I wrote, named
$HOME/.vim/colors/almost-default.vim and invoked by ":colorscheme
almost-default". It is a simple example which might help you create your
own. You will have to find out the names of the highlight groups for
which you need a non-default color. (Try "Comment" and "Identifier"; I
guess changing them will also change perlComment and PerlIdentifier, or
however they are named).
You can set different colors for console Vim and gvim by using, in the
same :highlight command, arguments cterm= ctermfg= ctermbg= on the one
hand, and gui= guibg= guifg= onthe other hand.
There are also a number of colorschemes available in your distribution
(in $VIMRUNTIME/colors) and at vim-online (which can be installed by
dropping them in one of the following:
- system-wide: $VIM/vimfiles/colors
- user-private on Unix: ~/.vim/colors
- user-private on Windows: ~/vimfiles/colors
). Don't change anything in $VIMRUNTIME or its subdirs, because any
upgrade can silently overwrite any changes you made there.
See
:help :highlight
:help :colorscheme
:view $VIMRUNTIME/colors/README.txt
HTH,
Tony.
" Vim color file
" Maintainer: Tony Mechelynck <[EMAIL PROTECTED]>
" Last Change: 2006 Jun 21
" This is almost the default color scheme. It doesn't define the Normal
" highlighting, it uses whatever the colors used to be.
" Only the few highlight groups named below are defined; the rest (most of
" them) are left at their compiled-in default settings.
" Set 'background' back to the default. The value can't always be estimated
" and is then guessed.
hi clear Normal
set bg&
" Remove all existing highlighting and set the defaults.
hi clear
" Load the syntax highlighting defaults, if it's enabled.
if exists("syntax_on")
syntax reset
endif
" Set our own highlighting settings
hi Error guibg=red
guifg=black
hi clear ErrorMsg
hi link ErrorMsg Error
hi StatusLine gui=NONE,bold guibg=red
guifg=white
hi StatusLineNC gui=reverse,bold
hi TabLine gui=NONE guibg=#DDDDDD
guifg=black
hi TabLineFill gui=NONE guibg=#AAAAAA
guifg=red
hi User1 ctermfg=magenta guibg=white
guifg=magenta
hi User2 ctermfg=darkmagenta guibg=#DDDDDD
guifg=magenta
" remember the current colorscheme name
let colors_name = "almost-default"
" vim: sw=2