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.
Press Shift+F6 or from the main menu, select Refactor | Rename. next to the highlighted element. You can press Tab to open the context menu and select the additional rename options. If you want to see the Rename dialog with more options, click the More options link or press Shift+F6 .
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.
The problem you are facing can be solved by the process called Refactoring. Place the cursor inside a variable you want to rename and press Ctrl + R . Then type other name and editor will change all occurrences of that variable. Save this answer.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With