I'm using IntelliJ IDEA 10.5.2
Example:
Say I want to rename this class to SomeAwesomeClass. If we do the Rename refactoring we get a dialog like this:
It has the cursor in the right place however the text is selected. So if we started writing "Awesome" the original name would disappear. So what I want to do is keep the cursor position but deselect the text.
I have not been able to find any way to do this. All things I've tried ether moves the cursor or removes the text or does nothing.
The fact that the cursor is in the right place to start with makes me believe this is a existing feature...
Sometimes code formatting can get out of sync, but there's an easy fix in IntelliJ IDEA. You can use ⌘⌥L (macOS), or Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings.
I use Ctrl+D to add to selection (discrete multiple select) the next occurrence of the string (or substring) highlighted. And to skip adding next immediate selection to selection but the one after it, I use Ctrl+K, Ctrl+D.
After you are done working with a tool window like the Project tool window, Debug window, Maven, or others, use Esc to return to the editor (instead of using the mouse to click in the editor window).
Press Ctrl+Alt+Shift+J to select all case-sensitively matching words or text ranges in the document.
In 11-eap (110.365) when you rename a class (Shift+F6):
Note a third Esc will exit rename.
In earlier versions (10.5.2) you can do a trick:
Before rename select one character (shift+arrow forward) where you want to end up (in SomeClass select C) then Shift+F6 and arrow back. I know it is a lot of keys to presses but in a long class name this helps.
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