Skip to content

Instantly share code, notes, and snippets.

@walf443
Forked from kan/tmt.vim
Created December 3, 2009 07:27
Show Gist options
  • Save walf443/247964 to your computer and use it in GitHub Desktop.
Save walf443/247964 to your computer and use it in GitHub Desktop.
" Vim syntax file
" Language: tmt
" Maintainer: Kan Fushihara
" Installation:
" To automatilcally load this file when a .rhtml file is opened, add the
" following lines to ~/.vim/filetype.vim:
"
" augroup filetypedetect
" au! BufRead,BufNewFile *.tmt setfiletype tmt
" augroup END
"
" You will have to restart vim for this to take effect. In any case it
" is a good idea to read ":he new-filetype" so that you know what is going
" on, and why the above lines work.
-
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
-
exec "runtime! syntax/html.vim"
unlet! b:current_syntax
-
"Put the perl syntax file in @perlTop
syn include @perlTop syntax/perl.vim
-
syn cluster tmtRegions contains=tmtOneLiner,tmtBlock,tmtExpression
syn region tmtOneLiner matchgroup=tmtDelim start=#^[%?]?\@!# end=#$# keepend contains=@perlTop containedin=ALLBUT,@tmtRegions keepend oneline
syn region tmtBlock matchgroup=tmtDelim start=#<[%?]?\?# end=#[%|?]?># keepend contains=@perlTop containedin=ALLBUT,@tmtRegions keepend
syn region tmtExpression matchgroup=tmtDelim start=#<[%|?]?=\?# end=#[%|?]?># keepend contains=@perlTop containedin=ALLBUT,@tmtRegions keepend
-
hi def link tmtDelim todo
-
let b:current_syntax = 'tmt2html'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment