1 " Copyright (C) 2004 Jason Woofenden
3 " This file is part of herkforth.
5 " herkforth is free software; you can redistribute it and/or modify it
6 " under the terms of the GNU General Public License as published by
7 " the Free Software Foundation; either version 2, or (at your option)
10 " herkforth is distributed in the hope that it will be useful, but
11 " WITHOUT ANY WARRANTY; without even the implied warranty of
12 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 " General Public License for more details.
15 " You should have received a copy of the GNU General Public License
16 " along with herkforth; see the file COPYING. If not, write to the
17 " Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 " This file implements syntax coloring in vim for the ascii representation of my colorforth source.
24 " To install, create a link to this file in ~/vim/syntax:
26 " ln -s `pwd`/syntax_coloring.vim ~/.vim/syntax/herkforth.vim
28 " Then add the following lines to the "filetypedetect" augroup in ~/.vim/filetype.vim
30 " au BufNewFile,BufRead blocks/[0-9][0-9][02468] setf herkforth
32 " (if you have no ~/.vim/filetype.vim then create the file with this text in it:
34 " augroup filetypedetect
35 " au BufNewFile,BufRead blocks/[0-9][0-9][02468] setf herkforth
38 " NOTE: be sure not to include the " marks at the begining of the lines in the above instructions
40 highlight execute ctermfg=Yellow ctermbg=Black
41 highlight define ctermfg=DarkRed ctermbg=Black
42 highlight compile ctermfg=DarkGreen ctermbg=Black
43 highlight brackets ctermfg=Blue ctermbg=Black
44 highlight comment0 ctermfg=Grey ctermbg=Black
45 highlight comment1 ctermfg=Grey ctermbg=Black
46 highlight comment2 ctermfg=Grey ctermbg=Black
47 highlight comment3 ctermfg=Grey ctermbg=Black
48 highlight string ctermfg=DarkGrey ctermbg=Black
50 syntax match compile /[^][; ]/
51 syntax match execute /[^][]/
52 syntax match define /^ *: [^ ]\+/
53 syntax match comment0 /^(.*/
54 syntax match comment1 / (.*/
55 syntax match comment2 /\\.*/
56 syntax match comment3 /^#! .*/
57 syntax match string /^" .*/
59 syntax region brackets start="^ *:\|]"hs=s+ end=" [[;]" contains=variable_def,tic,define,compile,const_def
62 " this is the range of characters that are considered part of a word (any
63 " non-whitespace printable 7-bit char). This enables the tags to work on all
64 " forth words (see README for more info on tags.)