Reputation: 7448
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.
Upvotes: 20
Views: 56428
Reputation: 61
Select your variable by right click > select refactor > rename
And rest all will be taken care by ide itself
Upvotes: 0
Reputation: 1708
Steps:
1: Put the cursor on the variable ex:
shift+f6
ex:
Upvotes: 1
Reputation: 1088
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.
Also, you can use shortcut Ctrl-Shift-R for replacing any word in project, it is useful if you working with huge project or your variable appears in config files.
Upvotes: 47