Intellij Live Template

Leonid picture Leonid · May 23, 2011 · Viewed 18.9k times · Source

Is there any way to use a default token value in Intellij Live templates? For example I have the following live template which declares a private variable that I would like to create nearly for every class:

private static final Logger logger = Logger.getLogger($CLASS$.class)

It seems unnecessary to type $CLASS$ every time when this live template is used, because it can be derived from the class in scope or filename. I was wondering if it is possible to use environment defined tokens in live templates as defaults?

Answer

CrazyCoder picture CrazyCoder · May 23, 2011

Check some other templates that already use the current class name:

enter image description here