On 02/07/10 16:26, Elena wrote:
Hello,
I'd like to port some Vim color schemes to my editor of choice (I'd
better not tell you which one ;-)
I somewhat understand the syntax of color scheme scripts, however I
don't know where to look for "highlighting groups" (I think they are
called like this). For instance, in some lines like these:
hi Identifier guifg=#a030a0 guibg=NONE gui=NONE
hi ModeMsg guifg=fg guibg=#b0b0e0 gui=NONE
hi VisualNOS guifg=fg guibg=#b0b0e0 gui=NONE
I'd like to know what kind of text Identifier, ModeMsg, VisualNOS
highlight.
Where can I look? Can I query a running Vim for help about that?
Thanks.
There are several places to look for.
- For any particular highlight group,
:verbose :hi <whatever>
will tell you where it was set. If you do that in a Vim instance where
no colour scheme was ever used since startup, it will tell you where (if
anywhere) the default was set.
- For highlight groups specific to one syntax type (~ one filetype),
look into that syntax script
:view $VIMRUNTIME/syntax/<whatever>.vim
replacing <whatever> by the result of
:setlocal syntax?
The syntax of these scripts is described under
:help syntax.txt
- for global highlight groups: most of them have help tags in the form
hl-<something>
:help hl-<Ctrl-D>
- Several of these global groups are defined by means of the 'highlight'
option (which I recommend to leave at its default, then use the :hi
command, preferably in a color scheme, if the default setting is not to
your liking).
- Others may be defined by doing ":syntax on",
:view $VIMRUNTIME/syntax/syncolor.vim
These names are just defined so that syntax scripts may later "link"
their own syntax highlight groups to them, to use the same colors: this
way, a colorscheme will e.g. define only Comment and that will
implicitly set cComment, vimComment, htmlComment, cssComment, etc. etc.
etc.; but if the colorscheme author wants it, he might decide e.g. to
color vimKeyword, perlKeyword, pythonKeyword, schemeKeyword and
rubyKeyword all differently so that embedded scripts in a vim script
will get distinctive colours.
- Some highlight groups might be defined by whatever sets the :match,
:2match or :3match commands, or the matchadd() function. For instance,
the MatchParen highlight is defined via a :3match command in the
matchparen script:
:view $VIMRUNTIME/plugin/matchparen.vim
In addition, see
:help :hi
:help :redir
:help 'more'
about capturing the current highlight colours
Best regards,
Tony.
--
Rule 46, Oxford Union Society, London:
Any member introducing a dog into the Society's premises shall
be liable to a fine of one pound. Any animal leading a blind person
shall be deemed to be a cat.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php