Re: Trouble with syntax highlighting in gvim70

2006-11-16 Thread Dudley Fox

Tony,
I actually did have it as a colorscheme originally, but I was still
calling it from _vimrc. Which lead to the same problem. I checked on
my older machine, still using gvim6x, and it has the highlight
commands directly in the _vimrc file. Obviously something changed
between 6 and 7, because when I ran scriptnames in gvim6x it was
calling _vimrc first as in gvim70, but I never saw a call to
syncolor.vim.

Thanks for the information. I may change over to that method on my
other machine, and see if I like it better.

Thanks,
Dudley



On 11/15/06, A.J.Mechelynck [EMAIL PROTECTED] wrote:

Yegappan Lakshmanan wrote:
 Hi,

 On 11/15/06, Dudley Fox [EMAIL PROTECTED] wrote:
 Yegappan,
 It is actually _vimrc. I just mistyped it.

 The output of :scriptnames is listed below. It looks like the _vimrc
 is the first thing loaded, and it does explain the problem I am seeing
 though. Did this change from gvim6.x? And is there a way to get what I
 want without having to manually highlight what I want everytime (other
 than editing the default syntax files).


 As described under :help syncolor, place the highlight group definitions
 in the $VIM\vimfiles\after\syntax\syncolor.vim file.

 - Yegappan


... or else, place them in a colorscheme. That will be a .vim script in the
colors/ subdirectory of a 'runtimepath' directory other than $VIMRUNTIME:
typically something like (on Windows, but in Vim notation)
~/vimfiles/colors/dudleyfox.vim if you want to invoke it with :colors
dudleyfox (without the quotes).

I'm attaching a fairly simple (but working) colorscheme as an example. It
defines only the groups for which other colours than the standard are desired,
including User1 and User2 which normally default to Normal but have
abbreviated codes for the status line, and PyjamaEven which is normally not
defined but is included in a syntax script of mine (unpublished yet).

I suppose you won't want to use this colorscheme as is but IMHO its
simplicity makes it easier as a pedagogical tool.


Best regards,
Tony.


 Vim color file
 Maintainer:   Tony Mechelynck [EMAIL PROTECTED]
 Last Change:  2006 Sep 06
 
 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 SpecialKey   guibg=NONE
hi PyjamaEven   ctermbg=greygui=NONEguibg=#FFD8FF
 white on red is not always distinct in the GUI: use black on red then
hi Errorguibg=red   
guifg=black
hi clear ErrorMsg
hi link  ErrorMsg   Error
 show cursor line/column (if enabled) in very light grey in the GUI,
 underlined in the console
if has(gui_running)
  hi clear CursorLine
  hi CursorLine guibg=#F4F4F4
endif
hi clear CursorColumn
hi link  CursorColumn   CursorLine
 do not make help bars and stars invisible
hi clear helpBar
hi link  helpBarhelpHyperTextJump
hi clear helpStar
hi link  helpStar   helpHyperTextEntry
 the following were forgotten in the syntax/vim.vim (and ended up cleared)
hi clear vimVar
hi link  vimVar Identifier
hi clear vimGroupName
hi link  vimGroupName   vimGroup
hi clear vimHiClear
hi link  vimHiClear vimHighlight
 display the status line of the active window in a distinctive color:
 bold white on bright red in the GUI, white on green in the console (where the 
bg is
 never bright, and dark red is sometimes an ugly sort of reddish brown).
hi StatusLine   gui=NONE,bold   guibg=red   
guifg=white
\   cterm=NONE,bold ctermbg=green   
ctermfg=white
 make the status line bold-reverse (but BW) for inactive windows
hi StatusLineNC gui=reverse,bold
\   cterm=reverse,bold
 define colors for the tab line:
 file name of unselected tab
hi TabLine  gui=NONEguibg=#EE   
guifg=black
\   cterm=NONE,bold ctermbg=lightgrey   
ctermfg=white
 file name of selected tab (GUI default is bold black on white)
hi TabLineSel   cterm=NONE,bold ctermbg=green   
ctermfg=white
 fillup and tab-delete X at right
hi TabLineFill  gui=NONE,bold   guibg=#CC   
guifg=#AA
\   cterm=NONE  ctermbg=lightgrey   
ctermfg=red
 tab and file number 1:2/3 (meaning tab 1: window 2 of 3) for selected tab
hi User1

Re: Trouble with syntax highlighting in gvim70

2006-11-16 Thread Charles E Campbell Jr

Dudley Fox wrote:


Tony,
I actually did have it as a colorscheme originally, but I was still
calling it from _vimrc. Which lead to the same problem. I checked on
my older machine, still using gvim6x, and it has the highlight
commands directly in the _vimrc file. Obviously something changed
between 6 and 7, because when I ran scriptnames in gvim6x it was
calling _vimrc first as in gvim70, but I never saw a call to
syncolor.vim.



The way one should call a colorscheme:

vim/colors/NewColorScheme.vim

and, in your .vimrc:

colors NewColorScheme

Is that how you were doing it?

Regards,
Chip Campbell