Preventing Tab Bloat with Visual Studio 2012
Sat, Sep 1 2012 17:26
As you debug your project, stepping through the code, you often end up with lots and lots of opened tabs in Visual Studio. With all of those tabs opened, it is hard to keep track of the tabs that are important.
Visual Studio 2012 provides two features to help with this issue:
To pin a tab, click the pin icon on the tab to the left of the close (x) icon. Or you can use the menu: Windows | Pin Tab. Or select Pin Tab from the tab's context menu.
The pinned tabs are pinned to the left in the Tab Well and will stay on the left. Newly opened tabs will appear to the right of the pinned tabs.
If you end up with too many tabs opened, you can right-click on one of the pinned tabs and select Close All But Pinned. That leaves you with just the tabs you wanted.
The way the tab pinning works can be adjusted using Tools | Options.
Visual Studio 2012 provides a special single tab in the right side of the Tab Well called the Preview Tab (shown in purple in the screen shot below). When a code file is opened in the Preview Tab, it replaces the prior contents of that tab. That helps prevent tab bloat.
There are several ways to open a code file in the Preview Tab:
- Select the Preview Selected Items button on the Solution Explorer toolbar (shown with a blue outline in the screen shot below). Then single click on any file in Solution Explorer to view it in the Preview Tab. (Double-click on a file to open it in a normal tab.)
NOTE: Clicking on a designer, such as Windows Forms, in Solution Explorer does not open the file in the Preview tab.
- Single click on any file in the Find Results window to open it in the Preview tab. (Double-click to open it in a normal tab.)
- Step through code in the debugger. Any code file that is opened as you step through is opened in the Preview Tab.
If you want to move a code file from the Preview Tab to a normal tab, click the Keep Open icon on the tab. The Keep Open icon is the icon just to the left of the close (x) icon.
The way the Preview Tab works can be adjusted using Tools | Options (see the screen shot earlier in this post).
Adjust these features to match the way you work with Visual Studio and minimize your tab bloat.