diff options
author | Will Woods <wwoods@redhat.com> | 2011-09-11 20:25:04 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2011-09-11 20:25:04 -0400 |
commit | 6d38df014559e4b195faa60b5e77eec4ef467a43 (patch) | |
tree | 6e904677230eb82e68d5920811e4a192d1398d2c | |
parent | 0bf68e212b1b4d33ecf48eb606fda10fe8f659da (diff) | |
download | vim-scripts-6d38df014559e4b195faa60b5e77eec4ef467a43.tar.gz vim-scripts-6d38df014559e4b195faa60b5e77eec4ef467a43.tar.xz vim-scripts-6d38df014559e4b195faa60b5e77eec4ef467a43.zip |
add ltmpl (lorax template) syntax/filetype scripts
-rw-r--r-- | ftdetect/ltmpl.vim | 2 | ||||
-rw-r--r-- | syntax/ltmpl.vim | 80 |
2 files changed, 82 insertions, 0 deletions
diff --git a/ftdetect/ltmpl.vim b/ftdetect/ltmpl.vim new file mode 100644 index 0000000..166e358 --- /dev/null +++ b/ftdetect/ltmpl.vim @@ -0,0 +1,2 @@ +au BufNewFile,BufRead *.ltmpl set filetype=ltmpl +au BufNewFile,BufRead */lorax/*.tmpl set filetype=ltmpl diff --git a/syntax/ltmpl.vim b/syntax/ltmpl.vim new file mode 100644 index 0000000..84d6a6f --- /dev/null +++ b/syntax/ltmpl.vim @@ -0,0 +1,80 @@ +" Vim syntax file +" Language: Lorax Template +" Filenames: *.ltmpl, */lorax/*.tmpl +" Maintainer: Will Woods +" Last Change: Sep. 9, 2011 +" Version: 0.1 + +" Quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syntax case match + +syntax include @Python syntax/python.vim +unlet b:current_syntax + +" TODO: split mako/ltmpl +" see /usr/share/vim/vim73/syntax/htmlcheetah.vim for an example + +syn match makoError contained /\S.*/ +syn match makoComment /^\s*##.*/ +syn region makoComment matchgroup=makoSpecial start='<%doc>' end='</%doc>' +syn region makoPython matchgroup=makoSpecial start=/<%\_s/ end=/%>/ contains=@Python +syn region makoPython matchgroup=makoSpecial start=/^\s*%\s*\%(if\|elif\|else\|for\|while\)/ end=/$/ contains=@Python +syn match makoSpecial /^\s*%\s*\%(endif\|endfor\|endwhile\)\s*/ nextgroup=makoError +syn region makoPython matchgroup=makoVar start=/${/ end=/}/ contains=@Python + +syn match loraxError contained /\S.*/ +syn match loraxFile contained /\S\+/ +syn region loraxAlt matchgroup=loraxSpecial start=/{/ end=/}/ keepend +syn region loraxQuote start=/"/ end=/"/ keepend +syn match loraxContinue contained /\\$/ + +syn keyword loraxKey install copy copyif move moveif hardlink symlink skipwhite nextgroup=loraxTwoFiles +" TODO + +syn keyword loraxKey mkdir remove skipwhite nextgroup=loraxManyFiles +" TODO + +syn keyword loraxKey append skipwhite nextgroup=loraxAppend +" TODO + +syn keyword loraxKey installkernel installinitrd skipwhite nextgroup=loraxInstallKern +" TODO + +syn keyword loraxKey chmod skipwhite nextgroup=loraxChmodFile,loraxError +syn match loraxChmodFile contained /\S\+/ skipwhite nextgroup=loraxOctalMode,loraxError +syn match loraxOctalMode contained /\o\{3,5}/ nextgroup=loraxError + +syn keyword loraxKey gconfset skipwhite nextgroup=loraxGconf +" TODO + +syn keyword loraxKey log skipwhite nextgroup=loraxOneArg +" TODO + +syn keyword loraxKey removefrom skipwhite nextgroup=loraxRemoveFrom +" TODO + +syn keyword loraxKey run_pkg_transaction skipwhite nextgroup=loraxError + +syn keyword loraxKey runcmd skipwhite nextgroup=loraxRuncmd +syn region loraxRunCmd contained start=// end=/$/ contains=loraxContinue,loraxQuote +syn keyword loraxKey replace +syn keyword loraxKey installpkg removepkg + +" define colors +hi def link makoComment Comment +hi def link makoSpecial Special +hi def link makoVar PreProc +hi def link makoError Error + +hi def link loraxKey Statement +hi def link loraxSpecial Special +hi def link loraxContinue Special +hi def link loraxQuote String +hi def link loraxOctalMode Constant +hi def link loraxError Error + +let b:current_syntax = "ltmpl" |