This is useful to know, as when debugging this shortcut can be used to quickly reload / hotswap classes.
Shift + F10
Shift + F9
Tab
Enter
Double Shift
F3
Shift + F3
F5
F6
Note that the Delete key on OS X / macOS is the equivalent of the Backspace key on other operating systems.
Shift+ F6
Surrounds a code block with an if
, for
, <editor-fold ...>
and more.
Esc
Note that you can use class name to narrow down the method/variable/constant search, for example to find symbol usersCollection
in class UserDAO
type:
UserDAO.usersCollection
To search for something that has multiple words, e.g., InetAddressCachePolicy
you can just type InAddCacPo
or something similar that contains parts of words in the whole name.
Selection with increasing scope
This comes handy when you want to select a block to extract a variable / method etc, no need to do a precise bracket matching, just put the caret somewhere in the statement and keep doing this
Selection with decreasing scope
This feature is also very useful when editing / playing with json documents in your IDE.
Vertical selection
Press and hold
and select normally using mouse / trackpad (the way you select a word in a row etc)
This is how it should look like
Multiple carets
Press and hold
and click where all you want to put a caret. You can choose to put multiple carets in a single line or across lines at different positions.
Now you can perform all operations that you would have been able to perform on a single selected word (hold Ctrl (windows) or option (mac OS) and use Left or Right keys to jump across words) and all those will affect all caret positions.
You can even cut / paste multiple selections from one place to another.
Having multiple carets is very usefult when you want to change the structure of text across many lines / many positions in same line.
Selecting duplicate occurences
Select some text and press
to select the next occurance of the same text.
You get one caret at each of the selected occurrence that could be used to change each occurrence simultaneously.
E.g., I've tried to put an example in this gif, hope it helps