]> git.mjollnir.org Git - tks.git/commitdiff
Added vim syntax highlighting for tks files.
authorNigel McNie <nigel@catalyst.net.nz>
Thu, 29 May 2008 12:30:41 +0000 (00:30 +1200)
committerNigel McNie <nigel@catalyst.net.nz>
Thu, 29 May 2008 12:30:41 +0000 (00:30 +1200)
The syntax highlighting itself was done by Martyn.

It will highlight files that have the extension .tks.

debian/rules
debian/tks.dirs
ext/vim/ftdetect/tks.vim [new file with mode: 0644]
ext/vim/syntax/tks.vim [new file with mode: 0644]

index 65dbe9af4b55bc405ffbce31623a00387f8b1b6b..e5024518df28a1dfd78321c38ac3d3ee34ec8a8c 100755 (executable)
@@ -29,6 +29,15 @@ binary:
        cp $(CURDIR)/tks.pl $(CURDIR)/debian/tks/usr/bin/tks
        cp -R $(CURDIR)/lib/WRMS* $(CURDIR)/debian/tks/usr/share/perl5
        
+       # Vim auto-syntax-highlighting stuff
+       cp ext/vim/syntax/tks.vim \
+           $(CURDIR)/debian/tks/usr/share/vim/vim70/syntax/
+       cp ext/vim/syntax/tks.vim \
+           $(CURDIR)/debian/tks/usr/share/vim/vim71/syntax/
+       cp ext/vim/ftdetect/tks.vim               \
+           $(CURDIR)/debian/tks/usr/share/vim/addons/ftdetect/
+       
+       
        dh_gencontrol
        dh_md5sums
        
index 9c71509cf00eb22a65d9357f9a8e2cb2a4a5edf9..7f1513d2a486b0561bdf53f36118362ee191b8cd 100644 (file)
@@ -1,2 +1,5 @@
 usr/bin
 usr/share/perl5
+usr/share/vim/addons/ftdetect
+usr/share/vim/vim70/syntax
+usr/share/vim/vim71/syntax
diff --git a/ext/vim/ftdetect/tks.vim b/ext/vim/ftdetect/tks.vim
new file mode 100644 (file)
index 0000000..ffcffca
--- /dev/null
@@ -0,0 +1,2 @@
+" detect tks filetype
+au BufRead,BufNewFile *.tks     set filetype=tks
diff --git a/ext/vim/syntax/tks.vim b/ext/vim/syntax/tks.vim
new file mode 100644 (file)
index 0000000..de1f5ab
--- /dev/null
@@ -0,0 +1,25 @@
+" Vim syntax file
+" Language: tks
+" Maintainer:   Martyn Smith <martyn@catalyst.net.nz>
+" Last Change:  2008 May 26
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syntax match tksWR "^\s*\S\+" nextgroup=tksTime skipwhite
+syntax match tksTime "\s[0-9.]\+" nextgroup=tksDescription skipwhite contained
+syntax region tksDescription start="\S" end="$" skipwhite contained keepend
+
+syn region comment    start="#" end="$"
+syn match date "^\d\d\d\d-\d\d-\d\d"
+syn match date "^\d\+/\d\+/\d\d"
+
+hi def link date Label
+hi def link comment Comment
+hi def link tksWR PreProc
+hi def link tksTime Type
+hi def link tksDescription String
+
+let b:current_syntax = "tks"