* Clifton Wood <[EMAIL PROTECTED]> [2002-06-04 13:31]: > Well, the itch became unbearable this past Friday and I spent most of > it learning to grok .vim, and of course, made a syntax highlighting > file for Templates, which seems to work well enough for me.
Would this be a bad time to mention that I've done one of these, too? I've called it tt2.vim, because I wrote it to use in conjunction with a TT-based mod_perl-handler named Apache::TT2. Like your version, mine has a bunch of issues, but I think they're mostly different issues. You can see my version at <http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/apache-tt2/tt2-vim/>. I haven't done anything to it in like 4 months, and have been using it constantly; it's very reliable and Does The Right Thing, for all of my purposes at least, but I've not tested it with vims less than 6.0. I had some problems with tag styles, so I ended up basically repeating a bunch of lines for each tag style (ugh!). But you can do: let tt2_tag_style="star" and tt2.vim will start highlighting [* foo *] constructs, and so on. You can also define interpolate and anycase, which do what you would expect. > Use information: Right now, I don't know of a way to make VIM auto > detect a template file when it is loaded, however it's fairly simple > to do by hand in VIM. > > - First, move the "template.vim" file into ~/.vim/syntax. > - Load any template file > - Execute the following commands: > :syntax on > :source ~/.vim/template.vim :source ~/.vim/syntax/template.vim > :set syntax="template" Auto-detection can be accoplished by modelines, or something like BufEnter *.tt :set ft=tt2 in your vimrc. I keep my syntax file in ~/.vim/syntax/tt2.vim; just doing :set ft=tt2 will invoke it. vim's search path for syntax files includes ~/.vim/syntax by default. (darren) -- Patriotism is the last resource of scoundrels. -- Samuel Johnson
