Hans' Vim Syntax Files

Extended BNF Syntax (ISO/IEC 14977 : 1996(E))

  1. Save ebnf.vim in ~/.vim/syntax (create the directories if necessary)
  2. Edit ~/.vim/filetype.vim, and put the following line in it:
    " EBNF Syntax
    augroup filetypedetect
        au! BufRead,BufNewFile *.ebnf	setfiletype ebnf
    augroup END
    

RELAX NG Compact Syntax

Sat Jun 21 2003 - added namespace highlighting, named parameters highlighting. Fixed assignmentMethod operator highlighting. Added '-','.' to isskeyword. Thanks Michael Smith.

This first revision highlights comments, documentation, keywords, and special characters. It is not context-sensitive, although I plan to make it so in the future.

  1. Save rnc.vim in ~/.vim/syntax (create the directories if necessary)
  2. Edit ~/.vim/filetype.vim, and put the following line in it:
    " RELAX NG Compact Syntax
    augroup filetypedetect
      au! BufRead,BufNewFile *.rnc	setfiletype rnc
    augroup END
    

BYU CS324 bin2a output

This syntax file will highlight the output of bin2a for CS324. It's amazing what a little color will do to help in making sense of these.

Three steps:

  1. Save cs324.vim in ~/.vim/syntax (create the directories if necessary)
  2. Edit ~/.vim/filetype.vim, and put the following lines in it:
    " cs324 bin2a syntax
    augroup filetypedetect
      au! BufRead,BufNewFile *.cs324	setfiletype cs324
    augroup END
    
  3. Redirect the output of bin2a to a file and edit it. Give the file the extension cs324. Example:
    bin2a field.dlx > field.cs324
    vim field.cs324

Here's a screenshot! Your colors may vary, but if you want my color scheme, check here.

StoryServer

This is what we used at http://www.mormon.org/ when I was an intern there. It's basically an HTML preprocessor based on Tcl, so I source html.vim and then define the StoryServer extension regions and keywords. I initially attempted to use the Tcl syntax inside, but it got messy and ugly, so until I have time to examine how tcl.vim is set up and modify storyserver.vim and/or tcl.vim to accomadate this will do. It's already better than the StoryServer template editor's built-in syntax highlighting, though.

I'll call this version 1.1. I consider it an alpha release. Changes from 1.0 include fixing the curlybrace string to do nesting right.

Installation

StoryServer uses temporary files with an .html extension to facilitate external editors. So to have syntax highlighting turned on automatically you need to tell vim to use storyserver.vim instead of html.vim. Tell vim to load storyserver.vim instead of html.vim by adding this line to mysyntax.vim (which is in C:\vim in my case):

au! Syntax html so $VIMRUNTIME/syntax/storyserver.vim

And of course save storyserver.vim in that directory.