在Intellij IDEA中更改$ {USER}环境变量 [英] Change ${USER} environment variable in Intellij IDEA

查看:2910
本文介绍了在Intellij IDEA中更改$ {USER}环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Intellij IDEA具有类/文件模板:

  / ** 
*由$ {USER }在$ {DATE}。
* /

其中 $ {USER} 默认登录用户名(或Ultimate版本的许可用户名)。



我需要在文件模板中具有与登录的操作系统用户名不同的名称。如何在IDEA中更改此变量?



我可以做什么,但这不是我要找的:




  • 直接更改模板标题。否,我需要更改IDE中所有模板和其他用法的变量。

  • 从bat / cmd / lnk启动IDEA,无论更改后的%USERNAME% OS环境变量。不,我正在寻找IDEA设置中的解决方案,而不是运行时设置。

  • 更改 idea.exe.vmoptions idea64.exe.vmoptions ),如在此这个的答案可能是一个很好的解决方案,但有一些缺点(适用于系统范围更改,需要管理员权限)。



所以,主要思想是:IDEA可能在本地用户设置中设置变量值?

解决方案

所以,最后在Jetbrains错误跟踪器,我发现这个问题,并且显然没有修复它是计划。如果您对某些解决方案感兴趣 - 对功能请求进行投票


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?

解决方案

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.

这篇关于在Intellij IDEA中更改$ {USER}环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆