From: Nigel McNie Date: Thu, 29 May 2008 12:30:41 +0000 (+1200) Subject: Added vim syntax highlighting for tks files. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c43e1afc64ae718a33b94f1f2a5f1dcb56b4f46d;p=tks.git Added vim syntax highlighting for tks files. The syntax highlighting itself was done by Martyn. It will highlight files that have the extension .tks. --- diff --git a/debian/rules b/debian/rules index 65dbe9a..e502451 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/debian/tks.dirs b/debian/tks.dirs index 9c71509..7f1513d 100644 --- a/debian/tks.dirs +++ b/debian/tks.dirs @@ -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 index 0000000..ffcffca --- /dev/null +++ b/ext/vim/ftdetect/tks.vim @@ -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 index 0000000..de1f5ab --- /dev/null +++ b/ext/vim/syntax/tks.vim @@ -0,0 +1,25 @@ +" Vim syntax file +" Language: tks +" Maintainer: Martyn Smith +" 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"