Hi,

Following your comments, I've converted my file to a scheme and placed it in
C:\Program Files\Vim\vimfiles\colors
For testing I also placed a bw.vim and a print_bw.vim in it.

The problem now is that it doesn't get loaded.
When I type :colorscheme eric it says E185: Can not find colorscheme eric
When I type echo g:colors_name it says undefined variable
When I type :colorscheme print_bw it switches to this scheme
When I type echo g:colors_name it says print_bw

Copying the print_bw file to print_bw2.vim and changing only the line
let g:colors_name = "blabla"
gives also the same errors with my ëric"scheme

Why

Rgds,
Eric


" Header information {{{
" Remove all existing highlighting. {{{
"==============================================================================
set background=light
hi clear
if exists("syntax_on")
 syntax reset
endif
"=========================================================================== }}}
" Name the scheme eric {{{
let g:colors_name = "eric"
"=========================================================================== }}}
" Define colorscheme as visual C++ {{{
"==============================================================================
hi Comment    cterm=NONE ctermfg=darkgreen  ctermbg=white gui=NONE
guifg=darkgreen guibg=white
hi Statement cterm=NONE ctermfg=blue ctermbg=white gui=NONE guifg=blue
guibg=white
hi Identifier cterm=NONE ctermfg=darkred ctermbg=white gui=NONE guifg=darkred
guibg=white
hi PreProc    cterm=NONE ctermfg=blue       ctermbg=white gui=NONE
guifg=darkblue  guibg=white
hi Type       cterm=NONE ctermfg=darkgray   ctermbg=white gui=NONE
guifg=darkgray  guibg=white
hi Constant   cterm=NONE ctermfg=red      ctermbg=white gui=NONE guifg=red
guibg=white
"=========================================================================== }}}
"" vim60: set foldmethod=marker: {{{
" }}}


From: "A.J.Mechelynck" <[EMAIL PROTECTED]>
To: Albie Janse van Rensburg <[EMAIL PROTECTED]>
CC: Eric Leenman <[EMAIL PROTECTED]>, vim@vim.org
Subject: Re: color loading sequence in GVIM
Date: Mon, 05 Feb 2007 17:01:57 +0100

Albie Janse van Rensburg wrote:
A.J.Mechelynck wrote:
Albie Janse van Rensburg wrote:
Eric Leenman wrote:
Hi,

I'm doing a reinstall of gvim and placing my color and font setting in a seperate file in the plugin.
This file is located in: "C:\Program Files\Vim\vimfiles\plugin"
And it contains the following:
[START OF FILE]
:hi Comment    ctermfg=darkgreen  gui=None guifg=darkgreen
:hi Statement  ctermfg=blue       gui=None guifg=blue
:hi Identifier ctermfg=darkred    gui=None guifg=darkred
:hi PreProc    ctermfg=blue       gui=None guifg=darkblue
:hi Type       ctermfg=darkgray   gui=None guifg=darkgray
:hi Constant   ctermfg=red        gui=None guifg=red

" GUI font instellingen
set guifont=courier:h7:w7
[END OF FILE]


What now happens is that the font is taken over but the colors aren't
For example:
When I type :hi Comment
vim returns:
Comment   xxx term=bold ctermfg=1 guifg=Blue

What do I do wrong?

Regards,
Eric

_________________________________________________________________
Check out all that glitters with the MSN Entertainment Guide to the Academy Awards® http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline2



Colour files should go into the vimfiles/colors directory,

Yes.

and needs to be named according to the filetype you want it to be used for. For instance, sql.vim will be loaded for .sql files.

No (see below).

You can further specify what filetype to use for a file by creating a filetypes.vim file in the vimfiles/ftdetect directory.

... a filetype.vim file in a directory in 'runtimepath', *and/or* one or more Vim script(s) of _any_ name in the ftdetect subdirectory of a directory in 'runtimepath'.

For more info about this, see

:help ftdetect

Also,

:help syntax

and also (more important)
    :help :colorscheme


Hope that helps


The files in the colors directory are what is called color schemes in Vim parlance, and correspond to what would be called "themes" or "skins" in other programs. Their names bear *no relation* to the files to be edited with them. Vim never loads them automatically but only as a result of the ":colorscheme <name>" command, which is roughly equivalent to ":runtime colors/<name>.vim" where <name>.vim is the name of an arbitrary colorscheme script.

The highlight groups to use for files of a given syntax are in the syntax subdirectory of directories in 'runtimepath', and they may define default colors for highlight groups not predefined in Vim, by using ":highlight default" commands (see ":help :highlight-default").
Absolutely. I had my syntax file and colorschemes info mixed up. I hope the OP reads your corrections. _Syntax_ files need to be named according to their application (language), whereas colorscheme files are used to change the colours of text _according_to_the_syntax_ file definition. The colorscheme effectively is applied over the syntax definition.

Indeed. This also means that ":syntax on" reloads the current colorscheme (if any, or sets the default colours if none), which may explain why Eric didn't see his colour highlights.

Note that since many syntax scripts define their color highlight groups by "linking" them to the default groups, setting highlights for said default groups will usually go a long way towards colouring everything. (For instance, by default the colours of the "Comment" group are reused for cComment, htmlComment, vimComment, etc., so unless you want to use different colours for each of these -- which IMHO would be rather pointless -- you can content yourself with defining Comment highlights and the various <something>Comment groups will all be set to that.)


":help :colorscheme"  indeed.
The OP is talking about a colorscheme file though (the first part, defining highlight groups), which should be placed in vimfiles/colors. As for the guifont setting, I personally do it in my vimrc file, but afaik it should work in a colorscheme file as well.

From what I can see, the highlight settings are loaded into a colorscheme (which will have the name of the .vim file containing them), so by running

:colorscheme <filename>

your highlight groups will get set, Eric. First move your file into the vimfiles/colors directory to avoid unpredictable results.


Best regards,
Tony.
--
[...]

_________________________________________________________________
FREE online classifieds from Windows Live Expo – buy and sell with people you know http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06

Reply via email to