IntelliJ IDEA shortcut to switch 2 words

I found it under "Code" menu : CTRL + ALT + SHIFT + or


Under the "Edit" menu look for the "String Manipulation" flyout and there should be an entry called "Swap Characters/Selections/Lines/Tokens".

Selecting both words and then using this command will present you with a dialog. Typing space into the dialog and hitting return will swap two words.

Ctrl+Shift+A will get you a shortcut to this command if you type "swap" after its dialog comes up.


If the same pattern of words occurs multiple times it would be more effective to perform a replace with Ctrl+R.