sponsor Vim development Vim logo Vim Book Ad

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 = '\[% %] <!-- -->'
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
tt2.tar.gz 0.1.3 2007-03-15 6.0 atsushi moriki Changed fileformat from 'dos' to 'unix'
Deleted 'echo' that print obstructive message
tt2.zip 0.1.3 2007-03-15 6.0 atsushi moriki Changed fileformat from 'dos' to 'unix'
Deleted 'echo' that print obstructive message
tt2.tar.gz 0.1.2 2004-01-02 6.0 atsushi moriki full-directive comment, lower case reserved words.
tt2.zip 0.1.2 2004-01-02 6.0 atsushi moriki full-directive comment, lower case reserved words, upload zip-archive.
tt2.tar.gz 0.1.1 2003-11-25 6.0 atsushi moriki Initial upload
ip used for rating: 3.231.219.178

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github