Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA shortcut to switch 2 words

Is there a shortut (or a way to define one) in IntelliJ to switch 2 words? Eg. final static Shortcut to switch to static final?

like image 696
akuma8 Avatar asked Aug 10 '18 20:08

akuma8


2 Answers

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.

like image 189
Jason Aller Avatar answered Oct 13 '22 11:10

Jason Aller


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

like image 29
akuma8 Avatar answered Oct 13 '22 09:10

akuma8