From c9925dd2bc26ad9b7f1395a8c1ddfb2786276ae6 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 13 Feb 2008 00:20:34 +0000 Subject: Added the support tree and the new taf vim hilighter. --- support/vim/ftdetect/taf.vim | 1 + support/vim/ftplugin/taf.vim | 23 +++++++++++++++++++++++ support/vim/install.sh | 22 ++++++++++++++++++++++ support/vim/syntax/taf.vim | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 support/vim/ftdetect/taf.vim create mode 100644 support/vim/ftplugin/taf.vim create mode 100755 support/vim/install.sh create mode 100644 support/vim/syntax/taf.vim (limited to 'support') diff --git a/support/vim/ftdetect/taf.vim b/support/vim/ftdetect/taf.vim new file mode 100644 index 0000000..f0815c4 --- /dev/null +++ b/support/vim/ftdetect/taf.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.taf set filetype=taf diff --git a/support/vim/ftplugin/taf.vim b/support/vim/ftplugin/taf.vim new file mode 100644 index 0000000..7b774cc --- /dev/null +++ b/support/vim/ftplugin/taf.vim @@ -0,0 +1,23 @@ +" Vim filetype plugin file +" Language: Taf + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +" Set format options -- allow comment formatting with gq, but disable +" other processing +setlocal fo-=tcrowan2 fo+=q + +" Set 'comments' to be the same as C/C++ +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// + +" Win32 can filter files in the browse dialog +if has("gui_win32") && !exists("b:browsefilter") + let b:browsefilter = "Textual Archive Format (*.taf)\t*.taf\n" . + \ "All Files (*.*)\t*.*\n" +endif diff --git a/support/vim/install.sh b/support/vim/install.sh new file mode 100755 index 0000000..9e05384 --- /dev/null +++ b/support/vim/install.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +for type in {ftdetect,ftplugin,syntax}/taf.vim; do + if [[ ! -e $type ]]; then + echo "You don't seem to be in the right directory." + echo "Run this from libbu++/support/vim" + exit + fi +done + +if [[ $(whoami) != "root" ]]; then + echo You should probably run this as root... + exit +fi + +for type in ftdetect ftplugin syntax; do + for dest in /usr/share/vim/vim*; do + if [[ ! -d $dest/$type ]]; then mkdir -v $dest/$type; fi + if [[ -e $dest/$type/taf.vim ]]; then rm -v $dest/$type/taf.vim; fi + cp -v $type/taf.vim $dest/$type + done +done diff --git a/support/vim/syntax/taf.vim b/support/vim/syntax/taf.vim new file mode 100644 index 0000000..70e57dc --- /dev/null +++ b/support/vim/syntax/taf.vim @@ -0,0 +1,36 @@ +" Vim syntax file +" Language: Nango +" Maintainer: None :) +" Last Change: 2006 Aug 24 + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + + +sy region Group matchgroup=Operator start=+{+ end=+}+ contains=NamePair,Value,Group,Title,Comment,Operator +sy region Title matchgroup=Operator start=+{+ end=+:+ keepend +sy region Title matchgroup=Operator start=+{[ \t]*"+ skip=+\\"+ end=+"[ \t]*:+ keepend + +sy region Value start=+"+ skip=+\\"+ end=+"+ +sy match Value +[^{}:=" \t\r\n]\++ +sy match Name +[^{}:=" \t\r\n]\+[ \t\r\n]*=+ contains=Operator + +sy match Operator '}' +sy match Operator '=' + +sy region Comment start=+//+ end=+$+ +sy region Comment start=+/\*+ end=+\*/+ +" sy region NamePair matchgroup=Name start=+[^{}:=" \t\r\n]\+[ \t\r\n]*=+ matchgroup=Value end=+[^{}:=" \t\r\n]\++ +" sy region NamePair matchgroup=Name start=+[^{}:=" \t\r\n]\+[ \t\r\n]*=+ matchgroup=Value end=+[^{}:=" \t\r\n]\++ + + +hi def link NamePair Normal +hi def link Name Identifier +hi def link Value Constant +hi def link Group Statement + -- cgit v1.2.3