Advertisement
Advertisement


What are the most useful Intellij IDEA keyboard shortcuts?


Question

I did a bit of googling hoping to find a post on IDEA shortcuts similar to Jeff's post on Visual Studio shortcuts (Visual Studio .NET 2003 and 2005 Keyboard Shortcuts), but didn't really spot anything that helped. Hopefully the answers to this question will fill the void.

2011/12/15
1
290
12/15/2011 3:55:31 PM


By far my favourite all purpose shortcut is Ctrl+Shift+A

It does a search as you type through all the commands in intellij. Not only that but when you find the command you want it also displays the corresponding shortcut key next to it!

2011/07/21

Here are the Intellij IDEA keyboard shortcuts I find most useful (listed in roughly the order of usage for me):

The shortcut I use the most is Ctrl + B (Go to declaration), to see what a method does, where a variable is declared etc. This is almost always followed by Ctrl + Alt + Left to get back to where I was (Ctrl + Alt + Right works to “go forward” again).

A related navigation shortcut is Ctrl + Alt + B, (Go to implementation). Press it when the caret is at the method name of an interface, and you get a pop-up list of all the places where this method is implemented, and you can select which one you want to go to (if there is only one implementation, you go straight there). The same goes for overridden methods.

The opposite of this is Ctrl + U (Go to super-method/super-class). If the caret is at the implementation of a method in an interface (indicated by the little green interface-symbol in the left gutter), this shortcut takes you to the interface itself.

When I want to see all the places where a method or variable is used (which I want to do a lot), I use Ctrl + Alt + F7 (Show usages). This gives you a pop-up list of all the usages, and you can easily navigate to each one. I prefer this over Alt + F7 (Find usages), which gives you the same information, but in a separate pane below.

To find classes, I use Ctrl + N (Go to class), which lets you search using only the capital letters in the class name (“camel humps”), and * as wildcard.

Yet another shortcut I use, both when reading and writing code, is Ctrl + P (Parameter info) at the arguments of methods and constructors, to see the types and names of the parameters.

When it comes to writing code, I use Ctrl + space (Basic code completion) a lot to auto-complete method names, variable names etc (or simply to see which methods are available for a certain object, by trying to auto-complete directly at the dot following the name of the object).

For searching in the current file I use Ctrl-F (Find - probably the least surprising shortcut in this list), F3/Shift + F3 (Find next/previous) to repeat the search, and Ctrl + Shift + F (Find in path) to search in the whole project.

Ctrl + W (Select successively increasing code blocks) is handy when selecting chunks of code. Repeatedly pressing it selects more and more of the code. Useful when searching, indenting, commenting out code etc.

If there are errors in the file, F2/Shift + F2 (Next/previous highlighted error) will jump to them.

I use the sequence Alt + C, N (Show Changes View) to see which files in the project I have modified compared to the subversion repository. To diff the current file against the version in the subversion repository, I use the sequence Alt + C, S, Y (Compare with the Same Repository Version). In the diff view, I use F7/Shift + F7 to navigate between the changes.

When not in the diff view, I use Ctrl + Shift + Alt + Up/Ctrl + Shift + Alt + Down to jump to the parts of the file that have been changed compared to the checked-out version. At each modification point, you see the corresponding part in the checked-out version in a pop-up window.

Finally, I run JUnit tests using Ctrl + Shift + F10.

Edit: One really useful shortcut that I've only started using in the last few months is Ctrl + E. It brings up a pop-up with the 15 most recently used files, and you just arrow down to the one you want and hit enter to navigate to it.

2012/03/21

According to the Jetbrains folks, it will have to be these, as they are for the one wearing the shirt: (Got that from Devoxx)

promotionalshirt

2017/02/08

Help\Productivity Guide

It tells you what are the shortcuts you use/don't use and displays usage statistics. It will guide you to the unknown features.

2008/11/20

Some of the time savers:

  1. Alt + Enter : show intention actions (like Eclipse quick fix)
  2. Ctrl + Alt + V : introduce variable (never type the left hand side of an assignment again)
  3. Ctrl + Shift + Space : smart completion ( even two levels down since IntelliJ 8 )
  4. Ctrl + W : select succesively increasing code blocks. Kind of obvious but a real time saver!

The Canoo blog contains some (+8) articles on some more advanced IntelliJ keyboard shortcuts.

The Key Promoter and Shortcut keys list plugins are really helpful for (constantly) learning new IntelliJ keyboard shortcuts.

2011/09/08

Source: https://stackoverflow.com/questions/294167
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]