February 2, 2006
I constantly rename variables. It's probably the single most frequent refactoring activity I do. And that's why I love Visual Studio 2005's built-in Smart Tags feature.
If you're not familiar with smart tags, check out K. Scott Allen's post; he has some nice screenshots illustrating how it works. Here's a demo movie of it in action:
Unfortunately, as Scott points out, the smart tags are a pain to use via the keyboard. To maintain compatibility with Microsoft Office's implementation of smart tags, they chose the same keyboard shortcut:
Shift + Alt + F10
Go ahead. Just try to type that. I double dast dare you. It's the most psychotic keyboard shortcut ever.
If that's the best keyboard shortcut they can come up, I'll stick with mousing over the approximately 5 pixel drop-down trigger area of the smart tag. This is really unfortunate, because the keyboard shortcuts in Visual Studio are generally well thought-out and usable in my experience.
Luckily, I don't have to suffer through this bad keyboard shortcut for a frequent activity. There's an alternate shortcut defined:
Ctrl + .
But that's still not very intuitive. I prefer to use ..
Alt + Down
.. which is an excellent physical map to the conceptual activity of "dropping down" a smart tag menu. You can easily set this new keyboard shortcut up via Options, Environment, Keyboard. Search for commands containing "ShowSmartTag":
Then just map a new global shortcut. Way better!
In general, it's safer to learn the default keyboard shortcuts for an environment-- too much customization is a self-defeating exercise. But sometimes the defaults are poorly chosen and you have no alternative but to customize them. What default keyboard shortcuts are you obliged to change in your environment, and why?
Posted by Jeff Atwood
I use ALT+1 and ALT+2 for View Find 1 and View Find 2 respectively.
I use F2 for renaming identifiers. It's the default hotkey used by ReSharper.
Thank you! I knew there had to be a hotkey for that function, but I could not find it. I didn't know what those smart tags were called, or the associated operation that showed them. Now I can re-map the shortcut to Alt+/ like I did for ReSharper and it's smart tag-like functionality.
As for other short cuts, I generally pretty happy with the default ones in Visual Studio. Usually it's just a matter of me knowing the shortcut, and then forcing myself to use it until it becomes habit. Generally the ones I use the most are F5, Ctrl+Shift+B, Ctrl+Shift+F9(clear breakpoints), F10, F11.
"Ctrl+Alt+Knee" equivalent keystroke are really painfull for common tasks :)
I reckon there's at least one piano player working on the VS team...
I studied the piano for about 12 years, starting from the age of 5. I think it had a positive impact on my typing abilities.
I don't find the Shift+Alt+F10 combination particularly challenging, and I suspect that's why.
So the answer is simple - study the piano intensively. And make sure you start age 5.
Failing that, now that ThinkPads reputedly have a Windows key (thanks, presumably, to IBM no longer owning them), we can start to petition for even more shift keys. Bring on Escape+Meta+Alt+Coke-bottle+Shift. (That's left coke-bottle - the full one rather than the empty one.)
if you like that, you should definitly check out the refactorings and sync edit features of Borlands developer studio product.
Get a keyboard with the function keys on the left and shift-alt-f10 is no problem to type.
Study the piano since age 5 or sit for a moment, meditate, and channel the spirit of Ian Griffiths.
I doubt there's much that Ian finds challenging. ;)
For the example mentioned above(Providing smarttags which basically asks whether the variable names should be renamed), why not the IDE just go ahead and change the instances of the variable instead of asking the user?
I always remap File/Close in Visual Studio to be Ctrl-W. That's what it is in Firefox, Internet Explorer, Microsoft Word, and gVim, among others. If it's a tabbed windowing environment, I expect that shortcut to work.