sponsor Vim development Vim logo Vim Book Ad

vm.vim : velocity vtl

 script karma  Rating 16/12, Downloaded by 1073  Comments, bugs, improvements  Vim wiki

created by
Sergey Markelov
 
script type
syntax
 
description
This is a Velocity Template Language syntax highlighter + filetype plugin. It features support of shorthand $my.some.reference(something) and longhand ${my.some.reference(something)} notations for both references and directives (including user defined macros). Everything described on the official web page (http://velocity.apache.org/engine/devel/user-guide.html) is supported. Supports directives along with user defined macros one line and multiline. Error handling of incorrectly placed directives. References can be mutliline, so that

$myref.long.array[ 3 ].
something.
take
.fromHere()

is also supported. Directives and references' methods and arrays can contain comments, unformatted text and doxygen comments.

Special references sequences (e.g. $foreach.parent.index or $foreach.topmost.hasNext) are recognized as keywords if they are contained.

Two types of strings are supported. References inside double quotes "" are highlighted.

Matchit support is introduced which allows you to jump from the start of a block (i.e. #if(), #foreach(), #define(), #macro(), #@any_user_macro()) to the end of the block (#end | #{end}) and vice versa with % just like you jump between opening and closing brackets.

Also all multiline directives supports folding.

Only directives described on the official web-page are recognized as system directives, user defined directives are recognized differently and can be one line or multiline.

Comments are automatically expanded to the next line while a user types them and appropriately recognized by vim engine.

NOTE: this differs from velocity.vim (http://www.vim.org/scripts/script.php?script_id=541) in many cases, which provides only basic capability, which doesn't include recogniton of multiline entities. It doesn't support system directives and error handling. No way to jump between openinig and closing directive. No support of nonparsable blocks. That script is really very basic (no offence to the author).

This one provides all the capabilites described on the official web-page (http://velocity.apache.org/engine/devel/user-guide.html)
 
install details
unpack to ~/.vim, or install pathogen.vim and unpack to ~/.vim/bundle/vtl

to make the sytax highlighting and ftplugin work appropriately one may need to add
autocmd BufRead,BufNewFile *.vm set syntax=vm filetype=vm
to his/her ~/.vim/ftdetect/syntax.vim  
 

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
vtl.zip 1.1 2012-07-14 7.0 Sergey Markelov Added #else and #elseif blocks to matchit section. See Xibur's blog post http://xibur.blogspot.com/2012/07/matchit-bmatchwords-strategy-for.html for further information.

Special Thank You to Xibur.
vtl.zip 1.0 2012-01-06 7.0 Sergey Markelov Initial upload
ip used for rating: 18.191.46.36

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