JetBrain ReSharper is an amazing tool that enhance the productivity of writing code and brings it at a completely new level.
I am working with ReSharper from a while now and I realized that I was not taking full advantage of it. One of the reason is because I didn’t know all the possible shortcuts available and I often relied on the mouse to accomplish a task.
The typical excuse is (from the The Productive Programmer Book):
I know there’s a keyboard shortcut that does this, but I’m in a hurry, so I’ll use the mouse instead and look up that keyboard shortcut late.
The fact is that:
Later never comes.
OK, good. I don’t want to be lazy. It’s time to learn it.
What do you do?
Why this happens?
Why then not learning the shortcuts while you work without upfront preparation?
I think that the way to go is the middle and the process can be split in two steps:
- Learn what are the ReSharper features and the most important shortcuts
- Learn new shortcuts while you work
OK, but what are the most important shortcuts?
1) Navigate To: ALT + `
This shortcut satisfy all your navigation needs based on where the caret is in the code editor.
2) Generate Code: ALT + INS
3) Refactor This: CTRL + SHIFT + R
This shortcut satisfy all your refactoring needs based on where the caret is in the code editor.
4) Go To Type: CTRL + T
5) Quick Fix: ALT + ENTER
While you code, this shortcut provides you a context menu with the list of possible quick fixes.
6) Go To Next/Previous Member: ALT + Up/Down
These shortcut allows you to quickly move between members in a class.
7) Insert Live Template: CTRL + E, L
This shortcut allows you to insert a live template (included your custom templates).
8) Inspect This: CTRL + SHIFT + ALT + A
This is a shortcut to the code exploration features.
9) Run Unit Tests: CTRL + U, L
Runs all the unit tests in the solution.
10) Go Back: CTRL + –
This is an interesting shortcut that I find very useful. When you navigate to a declaration or implementation after your exploration you often want to come back to the original location. This shortcut allows you to go back to the previous caret position.
I can’t work anymore without this shortcut.
I hope that you found this post useful.
For convenience, this is the list of all the most important shortcuts together:
- Navigate To: ALT + `
- Generate Code: ALT + INS
- Refactor This: CTRL + SHIFT + R
- Go To Type: CTRL + T
- Quick Fix: ALT + ENTER
- Go To Next/Previous Member: ALT + Up/Down
- Insert Live Template: CTRL + E, L
- Inspect This: CTRL + SHIFT + ALT + A
- Run Unit Tests: CTRL + U, L
- Go Back: CTRL + –
- Open ReSharper Menu: ALT + R
OK, now is time to work and be productive 😉