In past IntelliJ versions, ctrl+shift+f would search the entire project (no matter whether you had at some point used "find in path").
Add a keyboard shortcutOn the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Add Keyboard Shortcut. In the Keyboard Shortcut dialog, press the necessary key combination.
Select the code, and then either:
Code
> Surround With
I like to check the Productivity Guide under the Help menu from time to time. Not only does it tell me all the shortcuts, but it keeps track of how many times I've used each one and when I last used it. I can see how well I'm leveraging the shortcuts.
Ctrl Alt T brings a new terminal window in Linux systems. So right approach is Menu->Code and select Surround with...
Ubuntu:
"alt+c" -> "s" -> "6"
Mac:
"cmd+alt+t" -> "6"
Win (also Linux distrs if no conflict with system key binding):
"ctrl+alt+t" -> "6"
To recap and overview all situations, one might do:
Indicate which portion of code to surround:
Command:
Ctrl-Alt-T, 6
or Alt+C, S, 6
Command+Alt+T, 6
Alt+C, S, 6
Lastly, don't forget to use the Productivity Guide
under the Help menu
.
If you only need to wrap one line in a try-catch, you can use the Postfix Completion, available in IDEA 13.1 EAP and above.
The idea is that all you need to do is append .try
to your line and the completion will be able to wrap it in a try-catch.
For example:
System.out.println("Hello World!");.try
results in
try {
System.out.println("Hello World!");
} catch (Exception e) {
e.printStackTrace();
}
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