Enhance the Tabs in Visual Studio #23
Chapter 3, Navigating Visual Studio
|
95
HACK
be executed. Figure 3-17 shows some of my favorite settings, making undo
and redo easily accessible on the Back and Forward buttons, and also put-
ting BuildSolution on the middle button. You can configure the mouse to
execute whatever commands make sense for you.
These are the same commands that you use in the Com-
mand window
[Hack #46] and when creating keyboard short-
cuts
[Hack #24]. Any command that you can use from the
command window or assign to a keyboard shortcut can be
assigned to one of your mouse buttons.
Just as when working with shortcut keys, you can set the scope of your com-
mand assignments. Using the drop-down labeled “Use this mouse shortcut
in:”, you can set the scope of your command. The available scope settings
are Global, HTML Source Editor, HTML Designer, and Source Editor.
When determining scope, the more specific settings will override the global
settings. You might have the middle button configured to be BuildSolution
at the global level, but set to be OpenFile in the source editor. This means
that the setting for the source editor will override the global settings; if you
click the middle button on your mouse in source code view, the OpenFile
command will be called.
The VSMouseBindings power toy is easy to download, easy to use, and can
definitely make it easier to move around in Visual Studio.
HACK
#23
Enhance the Tabs in Visual Studio Hack #23
Visual Studio’s tabs can get crowded. Use a free add-in that can cut the
number of tabs in half.
One of the more frustrating things about Visual Studio is that, when you
have a dozen or so files open, you’ve got double that for files having multi-
ple tabs for code-behind or design, and you end up with a huge list of tabs
that you have to navigate through. This is time consuming and somewhat
annoying. There is a freely available add-in that works to alleviate some of
this pain, though. The add-in, called VSTabs and written by Jonathon
Payne, can be downloaded from http://www.zero-one-zero.com/vs.
This tool is referred to as a Technical Preview by its author.
For the most part, this add-in works perfectly, but you may
encounter a bug or two. Luckily, the code for the add-in is
available, so if you want to fix the bug yourself, you can do
so.
96
|
Chapter 3, Navigating Visual Studio
#23 Enhance the Tabs in Visual Studio
HACK
Once you have downloaded and installed the add-in, you will see a new tab
along the top of the document window. The new tab can be seen in
Figure 3-18.
Notice how the new tab groups the design view and the .cs view for Form1
under a single tab. You can switch between the two by simply clicking on
that section of the tab, and that document will be loaded. The tab control
will group documents under the same tab whenever there are two views for
the same file—this includes ASP.NET pages, Windows Forms, and web ser-
vices.
This add-in also adds another piece of functionality. It allows you to close a
tab by clicking on it with the middle mouse button. If you are a user of the
Firefox browser, you are probably already familiar with this type of func-
tionality—you can middle-click on a tab in that browser, and it will close
the tab. This is another great timesaving feature, since you no longer need to
select the tab and then move your mouse over to the Close button, but can
instead simply middle-click on the tab.
This is a quick and easy add-in to install and start using right away.
Figure 3-18. VSTabs

Get Visual Studio Hacks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.