Tuesday, September 4, 2018

Re: Vim highlight groups definition

On Tue, Sep 4, 2018 at 11:39 PM Robert Jones <robertgbjones@gmail.com> wrote:
>
> In brief, where and how are vim highlight groups defined?
>
> In more detail, and what I'm not asking...
>
> I'm not asking how to find out what groups are currently defined.
> I'm not asking how to define a group, which it seems to always begins by extending an existing group.
> I'm not asking how to map syntax to highlight.
>
> I am asking how the built-in highlight groups are defined. Are they in fact actually built-in, or is
> there some configuration file somewhere that begins with a blank slate and defines them from
> scratch?
>
> Kind Regards
>
> Rob.

The built-in highlight groups are defined in several places; and I'm
going to answer what you ask as well as some of the things you
explicitly don't ask, because they go together:

- The names of the highlight groups used by Vim itself are defined in
the 'highlight' option;
- Their values, as well of the names and values common to all
filetypes are defined in $VIMRUNTIME/syntax/synload.vim
- The highlight names and values used for each syntax type are defined
in the corresponding $VIMRUNTIME/syntax/<something>.vim, often but not
always by linking to highlight groups "common to all filetypes", see
above
- None of the files under $VIMRUNTIME should be modified by the user
(the next upgrade may replace them, overriding any user changes) but
you can add syntax scripts for new or existing syntax types in the
syntax/ subdirectory of other directories named in the 'runtimepath'
option
- For existing syntax types you may also (maybe in preference to an
additional after/syntax/ script) want to modify their values by means
of a colorscheme (a built-in one in the colors/ subdirectory of
$VIMRUNTIME or a third-party or owncoded one in the colors/
subdirectory of a directory named before $VIMRUNTIME in 'runtimepath')

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: