Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio - tips for managing work on many open files [closed]

How do you feel about VS making you hunt for a tab that you used just minutes ago when you have a bazillion open tabs? What about constantly dragging tabs around to keep the ones you use close together?

Oh, so you think AARGH, too? Then read on.

I work on a piece of software with dozens of projects and hundreds of files. It's really easy to get the tab bar to fill up - like when debugging, which can open a lot of files, most of which are just boilerplate, or not really interesting for the task at hand.
This makes the few files that are relevant to 'fall off' the tab bar, or a pain to find by skimming the visible tabs.

There are some solutions, some more widely known than others. Here's my top 3:

III. This works if you can exactly remember the file name (or at least the first letters): use the 'find box':

type: Ctrl-D >of yourFileName 

As you type the file name, you get autocomplete on the file names in the solution. More details here.

II. The most obvious one: using the 'active files' drop-down on the right of the tab bar which is alphabetically ordered.
Lesser known fact: use Ctrl-Alt-DownArrow to open that drop-down, then start typing the file name. You get the added benefit of visualizing the available choices. [info shamelessly stolen from here]

I. <drum roll/> This one is my personal favourite, and it's based on an undocumented feature of VS 2005/2008. When activated, it does one simple thing: clicking a tab moves it to the left-most side of the window. This basic action usually lets me find the tab I'm looking for in the first 3 to 5 tabs. It goes like this:

removed dead ImageShack link - sample animation

In order to enable this functionality, you have to get your hands dirty with the Windows registry.
Compulsory edit-registry-at-your-own-risk warning:
Editing the registry may make your network card drop packets on the floor. You have been warned.

Add this key to the registry for VS 2005:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0] "UseMRUDocOrdering"=dword:00000001 

or this for VS 2008:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0] "UseMRUDocOrdering"=dword:00000001 

You don't even have to restart VS to see it work! [plagiarized from here]
Now go on, give it a try!

Update: This trick no longer works in VS2010 Pro :(


This wraps up my part. Now it's your turn to share how you deal with tab hunting!

like image 1000
Cristian Diaconescu Avatar asked Nov 18 '08 17:11

Cristian Diaconescu


People also ask

How do I close all open files in Visual Studio?

#3: Right-Click->Close All But This If you want to close all but one open file, simply right-click on the tab and select Close All But This. This will close all open documents (floating included) except the tab you've right-clicked on.

How do I see all open tabs in Visual Studio?

For those using Visual Studio 2022, check the "Show tabs in multiple rows" setting in Tools > Options > Environment > Tabs and Windows section.


2 Answers

You can use Productivity Power Tools extension for VS.

Once installed go to Tools -> Options -> Productivity Power Tools -> Document Tab Well -> General -> then check "Show tabs vertically".

This will give you a list of open files on your left.

like image 171
o'aoughrouer Avatar answered Oct 22 '22 20:10

o'aoughrouer


Hold Ctrl, press Tab, and keep Ctrl held. Now you can use the arrow keys to choose any open file (right column) or tool window (left column.)

like image 22
Aidan Ryan Avatar answered Oct 22 '22 19:10

Aidan Ryan