ReSharper, day 3: ReSharper survival guide, or, What’s up with my keybindings?

Welcome to day 3 of my 31 Days of ReSharper. (This is actually Saturday’s episode, but I’m posting it Friday evening because I’ll be out of town on Saturday.)

ReSharper is awesome. But if you’re going to use it — especially version 2.5.x (the latest version at this writing) — you need to read this Survival Guide first.

See, Visual Studio is full of keyboard shortcuts. ReSharper changes a significant number of them. And you need to know what changed and how to deal with it.

ReSharper 2.0 just silently hijacked your key bindings. ReSharper 2.5 asks nicely whether it’s OK for it to hijack your keybindings, the first time you use each keystroke; but it gives you no way to go back and change your answer — which is almost worse, because you could end up stuck without a good way to access some of ReSharper’s best features.

So before you start using ReSharper, you need a Keybinding Survival Guide. This is it.

Surviving ReSharper’s politeness

Really, there are only two things to worry about. One is the changes in high-traffic shortcuts, of which there are only a few; I cover them below. The other is the ReSharper Shortcut Conflict dialog.

As I noted above, ReSharper asks nicely whether it can take over any given shortcut. The problem is, it asks you the first time you use that shortcut, at which point you’re almost certainly in the middle of actually doing something, and in no mood to answer a silly question. Add in the fact that there’s no undo for whatever answer you give, and that they don’t even tell you what other key you should use instead, and you’re left with a pretty lousy user experience.

(Don’t get me wrong. ReSharper is an awesome tool. You just have to get past this dialog box before you can start using it.)

Based on my own experience, I think your best bet is to accept all of ReSharper’s shortcuts. Then you can either learn the new shortcuts for anything that changed, or go back in and re-map anything you can’t live without. And you can tell ReSharper to quit interrupting you with this silly dialog box.

So after you install ReSharper, I suggest opening up a solution, putting the cursor in a parameter list somewhere, and hitting Ctrl+Shift+Space. The “ReSharper Shortcut Conflict” dialog will pop up.

ReSharper Shortcut Conflict dialog

Leave the setting at “Use ReSharper command”, check the “Apply to all ReSharper shortcuts” checkbox, and hit OK.

And there you go. One problem survived: it won’t be bugging you again.

Now all you have to do is learn the keystrokes that changed.

The changed keybindings, part I: High-traffic keys

I did the research, so you don’t have to. Here are the keystrokes you need the most:

  • Ctrl+Shift+Space no longer brings up Parameter Info. Use Ctrl+P (ReSharper’s enhanced parameter info) instead. It’s better anyway — especially when you’re facing Death By Overload in System.Drawing.
    • Ctrl+Shift+Space is now a variation on Ctrl+Space, which I’ll discuss later in the month when I talk about the Ctrl+Space family.
  • F12 (Go to Definition) and Ctrl+F12 (Go to Declaration) (what’s the difference, anyway?) are replaced by Ctrl+B. You can also use Ctrl+Click.
  • Shift+F12 (Find References) is now Alt+F7 (Find Usages). Usually they found alternate shortcuts that were better than the originals… obviously not in this case. Honestly, F7?
    • F12 and Shift+F12 now step forwards and backwards through the errors and warnings in a document.
  • Ctrl+Shift+R to record a temporary macro, and Ctrl+Shift+P to play it back, are no longer available. This one hurts; I wish they’d kept them as Ctrl+Alt+Shift+R or something.
    • Ctrl+Shift+P is now Parameter Info – Go to Previous Signature.
    • Ctrl+Shift+R is now Refactor This, and is the main reason I’m not too upset about losing the keystroke for recording macros. You’ll use this far more often than macros, trust me.

Part II: Other notable changes

Here are some other things that most people probably don’t use every day, but that are still significant enough to be worth noting.

  • Some Ctrl+key prefixes (Ctrl+B, Ctrl+D, Ctrl+E, Ctrl+F1, and Ctrl+W) are now commands in their own right, not prefixes. For example, Ctrl+B Ctrl+C used to clear bookmarks, but Ctrl+B is now Go to Declaration, so multi-key Ctrl+B commands are no longer available. Visual Studio already provides alternate keystrokes for many of these (e.g., many of the Ctrl+B commands are also available through Ctrl+K), and ReSharper adds its own alternate keystrokes for a handful of them.
    • Ctrl+B is now Go to Declaration.
    • Ctrl+D is now Duplicate Text.
    • Ctrl+E is now Go to Recent Files.
    • Ctrl+F1 is now Help – How Do I (formerly Ctrl+F1 H).
    • Ctrl+W is now Select Word / Extend Selection.
  • If you used Ctrl+Alt+Down Arrow to show the MDI list (same as clicking the down arrow at the top right of the document area), that keystroke is no longer available.
    • Ctrl+Alt+Up Arrow and Ctrl+Alt+Down Arrow are now Go to Previous Occurrence and Go to Next Occurrence.
  • Ctrl+/ to go to the Find combo (did anybody actually use that?) isn’t there anymore. Ctrl+D still brings it up, but only if the focus isn’t in the editor window.
    • Ctrl+/ is now Comment / Uncomment Selection.
  • F7 (View Code) and Shift+F7 (View Designer) are now just F7 to toggle between the two. Yay!
  • F6 no longer builds the solution. Use Ctrl+Shift+B instead.

Those are the short lists. I also made a complete list of every keybinding that changed when I installed ReSharper. This list only shows the keys that were changed or removed, not the ones that were completely added. Even so, it’s a long list. But if you find a keystroke that used to work and now does something weird, check out the full list. (Note that I had Ctrl+Shift+T bound to a macro to run tests; I think that Visual Studio binds it to something else by default, Swap Words or something weird like that.)

Leave a Reply

Your email address will not be published. Required fields are marked *