sponsor Vim development Vim logo Vim Book Ad

aftersyntax.vim : Allows a single language (filetype) to have multiple .vim/after/syntax/ files

 script karma  Rating 23/7, Downloaded by 2138  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.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
aftersyntax.vim.bz2 1 2004-07-02 6.0 Charles Campbell Initial upload
ip used for rating: 18.119.126.80

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github