Prof. Dr. Jan Bredereke

Vim Editor Syntax Highlighting for CSP and for Z

Overview

The vim editor (VI iMproved) is a free clone of the vi editor. One of the improvements is its capability of syntax highlighting. That is, keywords, operators, comments, etc. appear in different colours/graphical representations.

CSP (Communicating Sequential Processes) is a formal description technique for the specification of distributed communication systems. FDR is a verification tool for CSP by Formal Systems, Inc., using model checking. Even though CSP uses lots of special symbols, FDR defines an input syntax which is based purely on simple ASCII.

Z (pronounced "zed") is another formal specification technique with more support for data structures and less support for communication. Z often is typeset using LaTeX.

csp.vim is a command file for vim. It provides syntax highlighting for CSP specifications written in the FDR input notation.

tex.vim is a another command file for vim. It provides syntax highlighting for those LaTeX commands that are specific to Z. It builds on the standard syntax highlighting for LaTeX of vim.

You may use and distribute both csp.vim and tex.vim freely, in the same way as the vim editor itself. If you modify and improve it, please send a copy to the maintainer.

CSP

Information on the Command File

Download current version:
0.6.1
Download previous versions:
0.6.0, 0.5.0, 0.4.4, 0.2
History of changes:
csp_vim-changes.txt
Author and current maintainer:
Jan Bredereke
Home page:
http://homepages.hs-bremen.de/~jbredereke/en/software/vim/

Installing the Command File for vim >= Version 6.0

A version of csp.vim is part of the distribution of vim. In case you want to install a newer version, Put it into your runtime path. See

:help 'runtimepath'
and
:help mysyntaxfile-replace
in vim. For example, under Unix you may put csp.vim into the directory ˜/.vim/syntax/

Tell vim to switch syntax highlighting on. Create the file .vimrc in your home directory, if you don't have done so yet. Put into it:

" switch on syntax highlighting:
syntax on

Installing the Command File for vim < Version 6.0

Put the command file somewhere you like it. Under Unix, you might use ˜/.vim/csp.vim. Furthermore, create a file filetype.vim, if you don't have done so yet, e.g., as ˜/.vim/filetype.vim. Put into it:

autocmd Syntax csp source ˜/.vim/csp.vim
autocmd BufRead,BufNewFile *.csp,*.fdr  set ft=csp

Then tell vim where to look for filetype.vim. Create the file .vimrc in your home directory, if you don't have done so yet. Put into it:

" add personal filetype detection amendments (before ":syntax on"):
let myfiletypefile = "˜/.vim/filetype.vim"
" switch on syntax highlighting:
syntax on

Z/LaTeX

Information on the Command File

Download current version:
1.0.6
Download previous versions:
1.0.5
Author and current maintainer:
Jan Bredereke
Home page:
http://homepages.hs-bremen.de/~jbredereke/en/software/vim/

Installing the Command File

This file is not part of the distribution of vim. (We can't distinguish LaTeX with Z from LaTeX without Z by the file extension; I don't want to bother all LaTeX users with the overhead of supporting Z.)

You must put the file in your runtime path and switch on syntax highlighting, as for CSP (see above). However, the file must be read after the regular tex.vim. You can achive this, for example, by putting this file into the directory ˜/.vim/after/syntax/ under Unix.

You don't need special commands for file type detection, since you will write your Z specification in a file with the well-known extension ".tex" anyway.

That's all. Have fun!