1

Intellij IDEA has class/file templates like this:

/**
 * Created by ${USER} on ${DATE}.
 */

where ${USER} by default is logged in user name (or licensed user name for Ultimate versions).

I need to have name in file templates different from logged in OS user name. How can I change in IDEA this variable?

What I can, but this it not what i'm looking for:

  • Change template header directly. NO, I need to change variable for all templates and other usages in the IDE.
  • start IDEA from bat/cmd/lnk whatever with changed %USERNAME% OS environment variable. NO, I'm looking for solution in IDEA settings, not runtime settings.
  • changing idea.exe.vmoptions (idea64.exe.vmoptions) like described in this and this answers may be a good solution, but has some disadvantages (applies changes system wide, requires admin privileges).

So, the main idea: is it possible in IDEA to set variable values in local user settings?

Community
  • 1
  • 1
radistao
  • 14,889
  • 11
  • 66
  • 92
  • 1
    Possible duplicate of [IntelliJ IDEA override $user](http://stackoverflow.com/questions/19618669/intellij-idea-override-user) – Bas Leijdekkers Dec 26 '15 at 19:33

2 Answers2

1

So, finally on Jetbrains bug tracker i found this issue, and apparently no fix for it is planned. If you are interested in some solution - vote for the feature request.

radistao
  • 14,889
  • 11
  • 66
  • 92
1

It's not easy.

In IdealC2020,you can click menu Help-> Edit Custom VM Options.

you should append a line:

-Duser.name=authorNameX

then you restart IDEA , it works.

LvHeng
  • 11
  • 1