Kent's Vim Syntax Files

Here are four vim syntax highlighting files I've cobbled together for use where I work (or used to work). I'm sure they are not finished yet, but then all such setups lend themselves to a bit of tweaking now and then...

Note that you must use at least the 5.0m version of Vim to get these to work without adjusting the syntax (I did have them running under earlier alpha versions of Vim 5.0, but the syntax highlighting features for 5.0 have changed slightly as the alpha testing has progressed). You might even need Vim 6.1 for some of these. Anyway, these may serve as a basis for someone else to make improvements, so here you go. Let me know if you have a way to improve these; shouldn't be difficult :-).

--Kent Nassen, knassen AT umich DOT eee dee you

SAS Syntax File
This syntax file covers the BASE and STAT modules of the SAS System. It might give you some ideas for how you could alter it for how you use SAS. See for more information on the SAS System. Note that the official Vim distribution includes SAS highlighting, so this file may no longer be all that useful, but it does try to highlight a few more things.

FreeBSD Kernel Config Syntax File
This syntax file should highlight most of the FreeBSD 4.7-STABLE kernel configuration options and devices. Since kernel config files can begin with almost any comment or command, I've yet to figure out a way to have such files automatically recognized. Also, since editing kernel config files is not something I do a lot (well, every release maybe, but not every day) this is apt to get out of date rather fast. Each new release brings a new set of devices and options...such is progress.

SPSS Syntax File
This is for highlighting most of the SPSS statistical package's commands. Again, there is some overlap between keywords of different groups that will need to be resolved, and there're way too many subcommands all in one group, but it's a start. See for more about SPSS.

NOTE: I haven't used SPSS in several years (since taking a full time job programming in SAS) so this file is something I no longer use. If you do use SPSS and Vim, feel free to bring it up to date and maintain it (let me know if you do).

Cbentr/Cbgen Syntax File
This is an example of how I used Vim 5.0 (I haven't tried this with Vim 6.X) to help me in the editing I used to do at work (and probably something that no one else would use). cbg.vim is for a little-known text markup language called cbentr It's used for formatting codebooks for data collections, is derived from the OSIRIS era of codebook and data processing, and is probably specific to the work done at ICPSR. If you want more information about this, let me know.

cbentr/cbgen uses a small set of command tags that begin in the first column. All commands begin with a slash (/). Examples include /Q for question text, /V for variable number, and /C for the variable's codes, so when you see those in this syntax file, that's what's going on.

Years back, I used to edit a lot of codebooks for the Eurobarometer survey series, so many of the keywords in this file relate specifically to that (ESOMAR, NUTS, etc.) and not to cbentr/cbgen. Hey, why not include some of those special project terms? They're easy to change/remove when you move on to something else.

Note that Vim's highlighting can outline the errors in a file as well as the usual syntax constructions. In the cbentr/cbgen example, I've set "???" as an error to be highlighted in red. This lets me insert three question marks for things that are partially done or unverified and they'll be pointed out brilliantly the next time I open the file. (The Todo tag also highlights similar indications of undone work in the standard vim highlighting).

My operating environments:
Recently, Work: HP-UX 11.00 with Vim 5.3 compiled with Motif. Also Win2K and gui Vim 6.1. At home Vim 6.1 running on FreeBSD 4.7-STABLE with XFree86 4.2.0_3 on a Pentium 233MMX system with 256MB RAM and 26 gigs of hard disk.

Back to Kent's Vim Page
This page has been visited 8733+ times since I started counting.