aboutsummaryrefslogtreecommitdiff
path: root/support/vim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--support/vim/ftdetect/taf.vim1
-rw-r--r--support/vim/ftplugin/taf.vim23
-rwxr-xr-xsupport/vim/install.sh22
-rw-r--r--support/vim/syntax/taf.vim36
4 files changed, 82 insertions, 0 deletions
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 @@
1" Vim filetype plugin file
2" Language: Taf
3
4" Only do this when not done yet for this buffer
5if exists("b:did_ftplugin")
6 finish
7endif
8
9" Don't load another plugin for this buffer
10let b:did_ftplugin = 1
11
12" Set format options -- allow comment formatting with gq, but disable
13" other processing
14setlocal fo-=tcrowan2 fo+=q
15
16" Set 'comments' to be the same as C/C++
17setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
18
19" Win32 can filter files in the browse dialog
20if has("gui_win32") && !exists("b:browsefilter")
21 let b:browsefilter = "Textual Archive Format (*.taf)\t*.taf\n" .
22 \ "All Files (*.*)\t*.*\n"
23endif
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 @@
1#!/bin/bash
2
3for type in {ftdetect,ftplugin,syntax}/taf.vim; do
4 if [[ ! -e $type ]]; then
5 echo "You don't seem to be in the right directory."
6 echo "Run this from libbu++/support/vim"
7 exit
8 fi
9done
10
11if [[ $(whoami) != "root" ]]; then
12 echo You should probably run this as root...
13 exit
14fi
15
16for type in ftdetect ftplugin syntax; do
17 for dest in /usr/share/vim/vim*; do
18 if [[ ! -d $dest/$type ]]; then mkdir -v $dest/$type; fi
19 if [[ -e $dest/$type/taf.vim ]]; then rm -v $dest/$type/taf.vim; fi
20 cp -v $type/taf.vim $dest/$type
21 done
22done
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 @@
1" Vim syntax file
2" Language: Nango
3" Maintainer: None :)
4" Last Change: 2006 Aug 24
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14
15sy region Group matchgroup=Operator start=+{+ end=+}+ contains=NamePair,Value,Group,Title,Comment,Operator
16sy region Title matchgroup=Operator start=+{+ end=+:+ keepend
17sy region Title matchgroup=Operator start=+{[ \t]*"+ skip=+\\"+ end=+"[ \t]*:+ keepend
18
19sy region Value start=+"+ skip=+\\"+ end=+"+
20sy match Value +[^{}:=" \t\r\n]\++
21sy match Name +[^{}:=" \t\r\n]\+[ \t\r\n]*=+ contains=Operator
22
23sy match Operator '}'
24sy match Operator '='
25
26sy region Comment start=+//+ end=+$+
27sy region Comment start=+/\*+ end=+\*/+
28" sy region NamePair matchgroup=Name start=+[^{}:=" \t\r\n]\+[ \t\r\n]*=+ matchgroup=Value end=+[^{}:=" \t\r\n]\++
29" sy region NamePair matchgroup=Name start=+[^{}:=" \t\r\n]\+[ \t\r\n]*=+ matchgroup=Value end=+[^{}:=" \t\r\n]\++
30
31
32hi def link NamePair Normal
33hi def link Name Identifier
34hi def link Value Constant
35hi def link Group Statement
36