29

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!

SuperBiasedMan
  • 9,814
  • 10
  • 45
  • 73
Cristian Diaconescu
  • 34,633
  • 32
  • 143
  • 233

8 Answers8

15

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.

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
o'aoughrouer
  • 445
  • 5
  • 8
11

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.)

Aidan Ryan
  • 11,389
  • 13
  • 54
  • 86
8

ReSharper and its Recent Files feature works a lot better for me.

Ilya Ryzhenkov
  • 11,782
  • 1
  • 40
  • 50
  • I've just tried it, and it's a treat! :-) – Cristian Diaconescu Nov 28 '08 at 09:13
  • 1
    Actually, there's an even better feature in Resharper: Ctrl-Shift-T opens a 'search filename dialog' and that works very similarly to 'search symbol': if you are looking for VeryLongFileName.cs you can just write parts of the file in camel case, e.g. "VeLFN" and it will filter the files that match. – Cristian Diaconescu May 31 '10 at 12:46
  • Or better in most cases, use ReSharper's Crtl+T to navigate to the type name (not file name). – Dmytro Shevchenko Apr 10 '13 at 15:23
  • Resharper 8 re-mapped `Ctrl-T` to 'SEARCH ALL THE THINGS' - it searches file names, types, and even members. A bit strange at first, but after some getting used to, it really works well! For the *classic* `search for type`, hit `Ctrl-T` *twice*. – Cristian Diaconescu May 28 '14 at 17:16
  • Maybe, except that it crashes VS and if it does not crash it, it slows it down making it next to unusable – cd491415 Dec 07 '16 at 18:30
  • No, `Ctrl-Shift-T` isn't even better for the OP's question. If they really want to manage currently open files, the Recent Files menu is going to be quicker, by default. Although I'll agree it's nice to be aware of both. I bind GoToFile (`ctrl-shift-t`) to `ctrl-p` and GoToRecentFile (`ctrl-,`) to `ctrl-b` (mnemonically representing buffer). – shmup May 15 '17 at 18:40
6

I mostly use Ctrl-TAB to cycle through the tabs I have most recently been working on. I can seem to manage a stack of 4 or 5 files without thinking in this way. If the file is out of the stack then I usually settle for reopening it again using Ctrl-O.

Or if the file I want is related to a piece of code I am looking at, so highlighting a variable, method, etc that is defined in that file and hitting F12 works.

AEM
  • 1,354
  • 8
  • 20
  • 30
Rob Walker
  • 46,588
  • 15
  • 99
  • 136
4

I've created Tabs Studio add-in for Visual Studio exactly for this purpose - to comfortably work with a lot of opened files. Tabs Studio add-in offers multiple rows of tabs and tab grouping.

See Tabs Studio home page for more information.

Sergey Vlasov
  • 26,641
  • 3
  • 64
  • 66
  • 8
    And for the "low-low" price of $49, it can be all yours! It's a good product with a very high price tag for a feature that should be in-built in VS anyway... – Campbeln Jun 12 '15 at 03:26
  • VS 2022 v17.4.1 finally has this built in - for years paying a pretty good chunk of cash was the only option. See [answer](https://stackoverflow.com/a/73574180/8026947) and [answer](https://stackoverflow.com/a/74189196/8026947) – JeremyW Nov 18 '22 at 19:02
3

I ran into the same problems described here, so I created a visual studio addin to manage open documents in "sessions", it's free and open source, you can find more information on the codeplex project here

3

My company uses Visual Assist X. This provide numerous great features in Visual Studio, first and foremost a better "intellisense" capability. However, it also has an "Open File in Solution" dialog which allows me to type substrings of the file I'm looking for and filters the list accordingly. I highly recommend this software to any developer working with Visual Studio.

altruic
  • 354
  • 2
  • 7
0

Control-Tab and the ">of" trick are both useful. Neither of them quite work for me, though, especially when I've got a lot of open files or I want quicker access.

I like the free DPack collection of tools. There's a lot of neat stuff in there, some of which is built in to more recent versions of VS. I haven't seent anything like the file browser, though. It sits as a tool window (or dialog, if you prefer), and gives you an incrementally-filtered list of files in your solution. You can limit the list to open files if you use it as a modal dialog, apparently, though I haven't tried that.

USWare File Browser
(source: usysware.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179