From 0cce7a054ba818227494f4e48c129dde2cfc0e45 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 10 Feb 2013 21:57:18 +0000 Subject: Added vim syntax highlighting for gatstxt format. --- support/vim/ftdetect/gatstxt.vim | 1 + support/vim/ftplugin/gatstxt.vim | 25 +++++++++++++++++++++++++ support/vim/syntax/gatstxt.vim | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 support/vim/ftdetect/gatstxt.vim create mode 100644 support/vim/ftplugin/gatstxt.vim create mode 100644 support/vim/syntax/gatstxt.vim diff --git a/support/vim/ftdetect/gatstxt.vim b/support/vim/ftdetect/gatstxt.vim new file mode 100644 index 0000000..f6f3c1f --- /dev/null +++ b/support/vim/ftdetect/gatstxt.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.gtxt set filetype=gatstxt diff --git a/support/vim/ftplugin/gatstxt.vim b/support/vim/ftplugin/gatstxt.vim new file mode 100644 index 0000000..0a2b911 --- /dev/null +++ b/support/vim/ftplugin/gatstxt.vim @@ -0,0 +1,25 @@ +" Vim filetype plugin file +" Language: GatsTxt + +" 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 +setlocal fo-=t fo+=croql + +" 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 = "Nango files (*.gtxt)\t*.gtxt\n" . + \ "All Files (*.*)\t*.*\n" +endif + diff --git a/support/vim/syntax/gatstxt.vim b/support/vim/syntax/gatstxt.vim new file mode 100644 index 0000000..6722e8a --- /dev/null +++ b/support/vim/syntax/gatstxt.vim @@ -0,0 +1,38 @@ +" Vim syntax file +" Language: GatsTxt +" Maintainer: None :) +" Last Change: 2013 Feb 10 + +" 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 start=+{+ end=+}+ fold +sy region List start=+[[]+ end=+]+ fold + +sy match Int +[1-9][0-9]*[if]\?+ +sy match Flt +[0-9]*\.[0-9]*[if]\?+ + + +sy region Str start=+"+ skip=+\\"+ end=+"+ +sy keyword Bool true +sy keyword Bool false +sy keyword Null null + +sy match Ops '[{[:}\],]' + +" sy region Comment start=+//+ end=+$+ +" sy region Comment start=+/\*+ end=+\*/+ + + +hi def link Ops Operator +hi def link Str String +hi def link Bool Keyword +hi def link Null Keyword +hi def link Int Number +hi def link Flt Float -- cgit v1.2.3