Smart Tags and Sane Keyboard Shortcuts

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:

Smart tag rename demo movie

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":

Smart Tag keyboard customization

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?

Read more

Stay Gold, America

We are at an unprecedented point in American history, and I'm concerned we may lose sight of the American Dream.

By Jeff Atwood · · Comments

The Great Filter Comes For Us All

With a 13 billion year head start on evolution, why haven't any other forms of life in the universe contacted us by now? (Arrival is a fantastic movie. Watch it, but don't stop there - read the Story of Your Life novella it was based on

By Jeff Atwood · · Comments

I Fight For The Users

If you haven't been able to keep up with my blistering pace of one blog post per year, I don't blame you. There's a lot going on right now. It's a busy time. But let's pause and take a moment

By Jeff Atwood · · Comments

The 2030 Self-Driving Car Bet

It's my honor to announce that John Carmack and I have initiated a friendly bet of $10,000* to the 501(c)(3) charity of the winner’s choice: By January 1st, 2030, completely autonomous self-driving cars meeting SAE J3016 level 5 will be commercially available for passenger

By Jeff Atwood · · Comments