6

It's a quite simple question, but I can't find an answer to it using SO-Search and Google.

Is it possible to override the default $user VTL-variable used in file-templates globally, instead of setting it in each template with #set($user = "...") ?

Like some sort of setup-script for IntelliJ itself, where I can alter the value?

Thanks in advance.

By the way, I'm using IntelliJ Ultimate 12.1.6.

Pr0gr4mm3r
  • 6,170
  • 1
  • 18
  • 23
  • http://stackoverflow.com/a/34475894/907576 there I propose to vote up Jetbrains bug-tracker issue "Configure custom author name/email/organization to be used in file templates, completion etc" – radistao Dec 26 '15 at 22:41

1 Answers1

14

You want to modify the IntelliJ's .vmoptions file(s) in a text editor.

  • In Windows, edit IntelliJ-Install-Location/bin/idea.exe.vmoptions and/or IntelliJ-Install-Location/bin/idea64.exe.vmoptions.
  • In Mac OS X, edit IntelliJ-Install-App.app/Contents/bin/idea.vmoptions.

Within these files simply add or modify the following line:

-Duser.name=Your name

If you recognize this syntax, that's because Intellij IDEA uses the Java System Property user.name to fill $user and ${USER}.

Ky -
  • 30,724
  • 51
  • 192
  • 308
Pr0gr4mm3r
  • 6,170
  • 1
  • 18
  • 23
  • You can actually do this from inside intelliJ. This link describes it for android studio http://tools.android.com/tech-docs/configuration. Probably IDEA has the same – Klitos G. Sep 06 '16 at 09:37
  • Editing that file only works if you haven't used the application yet. If you have, then you need to edit the one at "%USERPROFILE%\.IdeaIC2016.2\idea.exe.vmoptions" (adjust for IDEA version). Obviously, I'm talking about the Windows version. – Jamie Nov 01 '16 at 23:31