12

How to change ${USER} value in JetBrains WebStorm?

I was searching under Settings-> File and Code Templates but there I can change only structure of the temple instead of value of variable USER.

/**
* Created by ${PRODUCT_NAME}.
* User: ${USER}
* Date: ${DATE}
* Time: ${TIME}
* To change this template use File | Settings | File Templates.
*/
LazyOne
  • 158,824
  • 45
  • 388
  • 391
NIKHIL C M
  • 3,873
  • 2
  • 28
  • 35

2 Answers2

14

By default ${USER} variable value is your login name as returned by java System.getProperty('user.name'). You can override it by passing a different name to java via -Duser.name option that you need to add to .vmoptions file: choose Help | Edit Custom VM Options..., add -Duser.name=your desired name to it

lena
  • 90,154
  • 11
  • 145
  • 150
12

Goto Settings-> File and Code Templates

choose desired file type and use set command.

  #set( $USER = "your desired name" )

For example: For Javascript

/**
 * #set( $USER = "your desired name" )
 * Created by ${USER} on ${DATE}.
 */
NIKHIL C M
  • 3,873
  • 2
  • 28
  • 35