Java IntelliJ 在多行中替换变量名
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27249226/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IntelliJ replace variable names in multiple lines
提问by daiyue
I am wondering is there a shortcut that can replace a variable name with a new name on multiple lines in the current Java
file for IntelliJ
. Is it just simply doing a find and replace operation, but it can't really solve the problem obviously.
我想知道是否有一个快捷方式可以在当前Java
文件的多行中用新名称替换变量名称IntelliJ
。是不是只是简单的做一个查找替换操作,显然并不能真正解决问题。
采纳答案by Insomniac631
Try to set cursor on variable and use shortcut Shift-F6- after that there are dialog frame for change name of variable and it changes all occurences of variable to setted name.
尝试将光标设置在变量上并使用快捷方式Shift-F6- 之后有用于更改变量名称的对话框,并将所有出现的变量更改为设置的名称。
Also, you can use shortcut Ctrl-Shift-Rfor replacing any word in project, it is useful if you working with huge project or your variable appears in config files.
此外,您可以使用快捷方式Ctrl-Shift-R替换项目中的任何单词,如果您使用大型项目或您的变量出现在配置文件中,这将非常有用。