JetBrain ReSharper is an amazing tool that enhances the productivity of writing code and brings it to 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 that 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 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 does this happen?
Why then not learning the shortcuts while you work without upfront preparation?
I think that the way to go is somewhere in between and the process can be split into two steps:
- Learn what are the ReSharper features and the most important shortcuts
- Learn new shortcuts while you work
Would you like 6 FREE MONTHS of a ReSharper Subscription? Join the Productive C# Annual Membership now.
OK, but what are the most important shortcuts?
1) Navigate To: ALT + `
This shortcut satisfies 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 satisfies all your refactoring needs based on where the caret is in the code editor.
4) Go To Everywhere: CTRL + T
5) Quick Fix: ALT + ENTER
While you code, this shortcut provides you with a context menu with the list of possible quick fixes.
6) Go To Next/Previous Member: ALT + Up/Down
This shortcut allows you to quickly move between members in a class.
7) Insert Live Template: CTRL + E, CTRL + 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 these shortcuts.
Open ReSharper Menu: ALT + R
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, CTRL + L
- Inspect This: CTRL + SHIFT + ALT + A
- Run Unit Tests: CTRL + U, L
- Go Back: CTRL + –
- Open ReSharper Menu: ALT + R
Would you like 6 FREE MONTHS of a ReSharper Subscription worth $199 dollars? Join the Productive C# Annual Membership and you get six free months of ReSharper.
OK, now is time to work and be productive 😉