TT2 syntax : Syntax Highlight for Template-Toolkit 2.x
script karma |
Rating 275/158,
Downloaded by 7442 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
atsushi moriki |
|
script type |
syntax |
|
description |
* THIS SCRIPT WILL BE NO LONGER MAINTAINED *
Maintainer was handed over. Please visit below to find updated version.
http://github.com/petdance/vim-perl
Syntax Highlight for Template-Toolkit 2.x
( http://search.cpan.org/~abw/Template-Toolkit/ )
Contain Perl code in PERL/RAWPERL directive. (runtime sytax/perl.vim)
No fold.
HTML syntax for including TT2 syntax. ( tt2html.vim / unfinished )
Can define START_TAG/END_TAG for your style.
|
|
install details |
Add this lines in your "filetype.vim":
au BufNewFile,BufRead *.tt2 call s:AdjustTT2Type()
func! s:AdjustTT2Type()
if ( getline(1) . getline(2) . getline(3) =~ '<\chtml'
&& getline(1) . getline(2) . getline(3) !~ '<[%?]' )
|| getline(1) =~ '<!DOCTYPE HTML'
setf tt2html
else
setf tt2
endif
endfunc
To define START_TAG and END_TAG you like, you can set any pair of tags to 'b:tt2_syn_tags':
"ASP"
:let b:tt2_syn_tags = '<% %>'
"PHP"
:let b:tt2_syn_tags = '<? ?>'
"TT2 and HTML"
:let b:tt2_syn_tags = '\[% %] <!-- -->'
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.231.219.178
|