aftersyntax.vim : Allows a single language (filetype) to have multiple .vim/after/syntax/ files
script karma |
Rating 23/7,
Downloaded by 2217 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Charles Campbell |
|
script type |
syntax |
|
description |
Currently one may have a single syntax file per filetype in the .vim/after/syntax directory. Such files are loaded after the main syntax handling file, and are used to provide additional customized syntax highlighting. But, what if you want two or more such files for some filetype? <aftersyntax.vim> solves just that problem...
For example, consider the C language and Andreechtchev Eugeni's opengl.vim extension for recognizing OpenGL functions and constants (vimscript#752) plus my blockhl.vim (vimscript#104) for highlighting leading tabs based on {} depth:
Example:
1. cd .vim/after/syntax
2. mkdir c
3. mv (wherever)/aftersyntax.vim c.vim
4. mv opengl.vim c
5. mv blockhl.vim c
Every time a C file is opened, both opengl.vim and blockhl.vim are sourced to provide their extra highlighting.
|
|
install details |
(see the example above)
1. cd .vim/after/syntax
2. mkdir [the filetype you want multiple-file support for]
3. mv or cp (ren or copy) aftersyntax.vim [new filetype].vim
4. put whatever additional syntax highlighting files you wish in the
.vim/after/syntax/[filetype]/
directory. They'll all be sourced for that filetype.
Note for non-Unix users:
1. Type vim
:echo &rtp
This will give you your "runtimepath". (see :help 'rtp')
You'll see something like
somepath/vimfiles
home:vimfiles
somepath:vimfiles
2. Under that directory, you may have such things as (I'll use
forward slashes (/) here as vim usually displays them, although
they may "actually" use backslashes (\) or dev:[some.path.vimfiles],
etc)
.../after
.../after/syntax
.../doc
.../plugin
etc. See :help 'rtp' for more...
3. You may then rename/copy this script into the .../after/syntax
directory, make a subdirectory as for Unix, and put your syntax
files in it.
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 142.132.191.50
|