Visitors are also reading...
← Previous Next →

My list of useful Intellij Live Templates

14 Feb 2012

I like Intellij's "live templates" feature and I try to use it as much as possible.
Here some live templates I just can't do without.

<![CDATA[ $TEXT$ ]]> $END$
assign to XML context.
debugger; /**nocommit**/
assign to Javascript. the "nocommit" is a precommit hook I have that makes sure it won't be committed.
private final static Logger logger = logger.getlogget($CLZZ$.class);
CLZZ is an Expression "className()" and I skip it if defined. ( This way there's usually nothing to edit ). Assign it to Java code.
METHOD is the expression "methodName()" and skipped if defined. Assign it to Java String. It is helpful to add the method name in log prints.
$ACCESS$ static final $CLASS$ instance = new $CLASS$();
ACCESS has a default value of 'public', and CLASS is "className()". (not skipped if defined). Assign it to Java code.