Re: user-defined syntax highlighting for multiple files
- Yakov Lerner wrote:
> 2. places your syntax defs into separate file underAs a user, you never need to modify anything in or under $VIMRUNTIME.
> ~/.vim/syntax/ and make it
> detectable by filetype mechanism. I believe you need
> to modify file $VIMRUNTIME/filetype.vim for that
And you should rather leave that directory tree alone, because any
upgrade (including a new v7 snapshot or a new v6 patchlevel) can
silently overwrite anything in it.
- If you create a new filetype, add a filetype.vim in some other
directory in 'runtimepath' (e.g. as ~/.vim/filetype.vim) with the
autocommands necessary to detect that new filetype.
- If you only alter the syntax for an existing filetype, filetype.vim
will usually need no change; instead, your changes will go in e.g.
~/.vim/after/syntax/<something>.vim (for small changes) or in
~/.vim/syntax/<something>.vim (for a rewrite from scratch) (where
<something> is the syntax name, which is normally the same as the
filetype). (On Windows, ~/vimfiles replaces ~/.vim; on most platforms,
there is also a $VIM/vimfiles [not .vim] which is sytem-wide rather than