ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Java Velocity

by jampow ST2/ST3

syntax highlight and snippets for velocity

Details

  • 2015.06.11.00.29.56
  • github.​com
  • github.​com
  • 3 years ago
  • 2 hours ago
  • 5 years ago

Installs

  • Total 17K
  • Win 9K
  • OS X 4K
  • Linux 3K
May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7
Windows 6 3 0 4 8 9 5 10 3 1 2 5 3 3 3 6 0 1 1 11 8 2 3 1 4 4 4 6 7 11 1 0 6 8 13 10 3 0 2 7 5 3 6 9 6 1
OS X 0 3 0 0 2 3 3 2 1 0 1 1 5 5 3 4 2 1 1 2 3 1 2 0 1 1 0 3 1 3 1 1 1 1 1 2 1 0 0 5 3 4 2 4 1 0
Linux 0 1 2 1 2 3 1 1 4 0 1 3 0 1 0 2 1 1 2 1 0 3 2 3 1 1 3 3 1 1 1 0 3 2 1 0 4 0 1 0 3 2 1 2 2 3

Readme

Source
raw.​githubusercontent.​com

Installation

Gitter

Via Package Control, search for “velocity”

Or paste the repo folder into the <SublimeText2Folder>/Packages

Snippets

  • for - foreach #foreach( $var in $!{colection} ) ... #end
  • param - get url param $!{request.getParameter( 'someparameter' )}
  • host - get host name $!{link.getHost()}
  • if - if structure, without else #if(condition) ... #end
  • ifel - if else structure #if(condition) ... #else ... #end
  • ifparam - if some url param #if($!{request.getParameter( 'someparameter' )}) ... #end
  • el - only an else #else
  • set - set #set( $var = _value_ )
  • read - gets the content of file $_reader.read("path/to/file.ext")
  • $ - use variable $!{var}
  • ! - html comment “”
  • vm - velocity head #!vm;utf-8
  • + - addition $math.add($number, $number)
  • - - subtraction $math.sub($number, $number)
  • * - multiplication $math.mul($number, $number)
  • / - division $math.div($number, $number)
  • debug - html output debug with parameter
  • par - parse #parse("url")
  • exist - return a boolean if file exists $include.exists("filepath")
  • isweb - return a boolean if plataform is web $_userAgent.isWeb()
  • issmart - return a boolean if plataform is smart $_userAgent.isSmart()
  • isfeature - return a boolean if plataform is feature $_userAgent.isFeature()
  • jsontos - velocity object to string $_json.toString(obj)
  • request - return of the url requested $_json.request(url)
  • ept - is empty? .isEmpty()
  • dtformat - date format $date.format("pattern", $date.getSystemTime())
  • sysdate - system date $date.getSystemTime()
  • count - Velocity counter, foreach index $velocityCount
  • .up - Velocity toUpperCase .toUpperCase()
  • .str - converts to string .toString()
  • .ks - Object keys to Array .keySet()
  • st - STOP!!! Hammer time! #stop
  • ctype - set the content type of header's request $response.setContentType("type")