Make all opened document tabs visible - visual-studio

I would like to see all files or documents I've opened in Visual Studio. I do not want them to be auto hidden or hidden on overflow.
How can I achieve it?

One of the built-in option to do so: use pinned tabs.
http://dailydotnettips.com/2016/01/21/persevering-and-separating-the-pinned-tabs-in-visual-studio/
If you don't want to read a external page just for setting:
Tools -> Options -> Environment -> Tabs and Windows -> Show pinned tabs in a seperate row
It's not completely what you want, but it's free and may be useful.

Maybe it's not exactly what you search, but here is a way to at least get a second row for pinned tabs.
Effectively get you more space for opened files:
Tools -> Options -> Environment -> Tabs and Windows -> Show pinned tabs in a seperate row

Visual Studio has this extension taken from msdn.microsoft.com tested and worked
Simple installation: download, doubleclick to install, restart VS IDE. Then open all the tabs you want they all will be displayed and No hidden.
https://visualstudiogallery.msdn.microsoft.com/EBF6137E-AA2D-4DC9-860A-F04168F11CD7
Dung Le.

It's worth noting that starting in VS 2019 v16.4, you can now have "vertical tabs" which will list all open tabs vertically, making it easy to see all open files.
https://learn.microsoft.com/en-us/visualstudio/ide/customizing-window-layouts-in-visual-studio?view=vs-2019#vertical-document-tabs

In Visual Studio 2022, this issue now has a native solution. Go to Tools -> Options -> Environment -> Tabs and Windows -> Show tabs in multiple rows. Excess tabs will be shown on additional rows. There doesn't seem to be a limit on how many rows this can use.
Another relevant option that some may find useful; you can choose "Show invisible tabs in italic in tab dropdown menu". The dropdown button is only visible when you hover your mouse near the end of the row of tabs. Showing invisible windows in italics makes it easier to identify windows that are only visible in the overflow menu.

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

For Visual Studio Code
If you want to see all the opened tabs,
you can simply on wrap tabs option in the VS Code settings
settings > User > Workbench > Editor > Wrap Tabs

Related

Visual Studio 2010: Close All But Selected

When I have a bunch of tabs open, the "close all but this" option is very useful. There are times that I'd like to keep 2 or 3 windows open. Is there a way to multi-select the tabs I want and "close all but selected"?
From the File, Edit, View menu: Window > Windows…
I use the Productivity Power Tools extenstion which allows you to 'Pin' pages on the editor frame, among other awesome features.
•Pinned tabs
Allows you to pin tabs to keep them always visible and available.
Then there is the option to "Close all but pinned"
That should do exactly what your trying to accomplish.

Open two instances of a file in a single Visual Studio session

I have a file, xyz.cpp. I want to open two instances of this file in Visual studio (BTW, I am using Visual Studio 2005). Why would I want to do so? I want to compare two sections of the same file side by side. I know workarounds such as:
Make a copy of the file. But the problem is that it's not elegant, and I don't want to make copies every time I am faced with this.
I can split the window into two. The problem with split it that I can split it horizontally only. The result of a horizontal split is that the right half of my screen is white space.
If I were able to split it vertically or open two instances of the same file, it would increase the number of lines of code I can compare.
Visual Studio
Here's how to do it...
Select the tab you want two copies of
Select menu Window → New Window from the menu.
Right click the new tab and select New Vertical Tab Group
If New Window is not listed in the *Window menu note that the command does exist, even as of Visual Studio 2017. Add it to the Window menu using menu Tools → Customize → Commands. At that point decide where to put the New Window command and select Add Command.
VS Code
In Visual Studio Code version 1.25.1 and later
Way 1
You can simply left click on your file in the side-panel (explorer) and press Ctrl + Enter.
Way 2
Simply right click on your file in the Visual Studio Code side-panel (explorer) and select the first option open to the side.
For Visual Basic, HTML and JScript and RDL Expression, the Window > New Window option mentioned in PaulB's answer is disabled.
However an option can be changed in the Registry to enable the menu item.
All other languages do not restrict to a single code window so you can use PaulB's answer without editing the registry.
Enabling New Window in Windows Registry.[1] [2]
Go to the following registry key. This example is for Basic (Visual Basic), but the key is also there for HTML, JScript and RDL Expression.
64-bit OS: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Languages\Language Services\Basic
32-bit OS: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Languages\Language Services\Basic
Find the value Single Code Window Only and do one of the following:
Set it to 0
Rename the value
Delete the value (use caution!)
This will enable the "New Window" menu item, but it may still not be visible in the menu.
Adding Menu Item
To actually see the New Window menu item I had to add it back into the menu:
Tools > Customize... > Commands > Add Command...
Select 'Menu Bar' the select the 'Window' menu in the dropdown
Add Command... > Window > New Window > OK
Restoring Registry Value
Copy-paste this to notepad, save as a .reg file and import the file into your registry to restore the initial setting.
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Languages\Language Services\Basic]
"Single Code Window Only"=dword:00000001
Go to menu → Windows → New Window:
You can use the Windows → New Window option to duplicate the current window. See more at: Why I like Visual Studio 2010? Undock Windows
Open the file (if you are using multiple tab groups, make sure your file is selected).
Menu Window → Split
(alternately, there's this tiny nub just above the editor's vertical scroll bar - grab it and drag down)
This gives you two (horizontal) views of the same file. Beware that any edit-actions will reflect on both views.
Once you are done, grab the splitter and drag it up all the way (or menu Window → Remove Split).
How to open two instances of the same file side by side in Visual Studio 2019:
Open the file.
Click Window → New Window.
A new window should be open with the same file.
Click on Window → New Vertical Document Group.
Result:
With the your file opened, go to command window (menu View → Other Windows → Command window, or just Ctrl + Alt + A)
Type:
Window.NewWindow
And then
Window.NewVerticalTabGroup
worked for me (Visual Studio 2017).
Or using menus:
Menu Window → New Window
Menu Window → New vertical tap group
Luke's answer didn't work for me. The 'New Window' command was already listed in the customize settings, but not showing up in the .js tabs context menu, despite deleting the registry setting.
So I used:
Tools
Customize...
Keyboard...
Scroll down to select Window.NewWindow
And I pressed and assigned the shortcut keys, Ctrl + Shift + W.
That worked for me.
==== EDIT ====
Well, 'worked' was too strong. My keyboard shortcut does indeed open another tab on the same JavaScript file, but rather unhelpfully it does not render the contents; it is just an empty white window! You may have better luck.
Window menu, New Horizontal/Vertical Tab Group there will do, I think.
When working with Visual Studio 2013 and VB.NET I found that you can quite easily customize the menu and add the "New Window" command - there is no need to mess with the registry!
God only knows why Microsoft chose not to include the command for some languages...?
For newer versions (such as Visual Studio 2017)
Select the window you want to duplicate.
Go to the window tab and click on split at the top of the list.
When you are done, click it again to toggle it off.
For file types, where the same file can't be opened in a vertical tab group (for example .vb files) you can
Open 2 different instances of Visual Studio
Open the same file in each instance
Resize the IDE windows & place them side by side to achieve your layout.
If you save to disk in one instance though, you'll have to reload the file when you switch to the other. Also if you make edits in both instances, you'll have to resolve on the second save. Visual Studio prompts you in both cases with various options. You'll simplify your life a bit if you edit in only the one instance.
I don't have a copy of Visual Studio 2005, but this process works on Visual Studio 2008:
Open xyz.cpp along with some other file.
Right click on tab header and select new vertical tab group.
Left click on that other file in the first tab group.
Open xyz.cpp through solution explorer again.
You should now have two instances of file in separate vertical tab groups.
To work on two sections of one long file, simply use a shortcut (Ctrl + \) or click on the split editor window while you are on the selected tab. The icon is on the top-right of the Visual Studio Code.

How do I get a code window to split vertically in Visual Studio 2008? (not HTML mode)

In Visual Studio 2008, it seems that Window -> Split only gives me a horizontal split, and Window -> New horizontal tab group does not allow me to edit the same file in both panes.
Note that I am talking about C# code windows, not HTML editing mode.
I want to edit the same file in two horizontally arranged panes.
Is this possible? Free add-ons are fine.
Edit: I have CodeRush Express installed, and it seems to have done something to my code window borders.
Edit #2: It's not CodeRush. I tried on VM with no CodeRush, and I have exactly the same issue.
Ok, I found the solution here.
The answer is:
Window -> New Window
Window -> New Vertical Tab Group
This duplicates the current tab so you'll get [Form1.cs:1] and [Form1.cs:2] tabs; and then you can use a vertical tab group to view them side by side.
I believe that it's not CodeRush's fault. A vanilla 2008 install only lets you do the split view with one file on the top and one file on the bottom. The only side-by side option is the horizontal tab-group feature (with the problem of only having a file open in one of them, as you mentioned.)
The obvious workarounds would be to either make a read-only copy of the file elsewhere and use that in one tab-group, or open up a second instance of VS. It does have decent handling of files that get changed in other apps, so having the same file open in two instances isn't a problem.
In VS2010 I couldn't find the Vertical Tab group button. The workaround is:
1. Open Fullscreen mode
2. Click and drag the window to the far right (or left) and it should give
you an option to view both windows side by side.
3. Exit full screen mode and you should now have the ability to click and
drag windows between vertical tab groups, and it even now allows you to
drag to a new vertical tab group.
No idea why you have to jump into fullscreen first, and i seem to remember not having to do that before.
As a one-time developer on CodeRush, I doubt that this would be caused by CodeRush Xpress. I'm currently running the latest beta of CodeRush 9.1.0 on Visual Studio 2008, and splits are working fine. However, you could certainly try uninstalling CodeRush Xpress to see if that clears up the problem. If it does, I would recommend posting in DevExpress' peer-to-peer forums.
alt text http://diditwith.net/content_images/CRXSplits.png
I like the vertical tab group option. The only thing that bothers me about it is that I cannot put the solution explorer on both windows (Or properties for that matter). I have to navigate all on one side and move screens around.
I found this nifty add on tool for VS 2012 that allows you to compare two files at the same time and make changes.
Check this out:

How do you keep Visual Studio tabs sorted

Is there a built in way, or a free add-in, that can keep the tab bar of open files sorted in alphabetical order? Once sorted, how can I get CTRL-PageUP/DOWN (or other shortcut) to jump left/right instead of most/least recently viewed file.
Thanks,
Kurt
In VS 2017, using the Productivity Power Tools extension you can navigate to:
TOOLS > Options > Productivity Power Tools > Custom Document Well
Here you'll see a 'Sorting' section, where you can select 'Alphabetically'.
With the new settings applied the CTRL + PAGE DOWN (or in my case, CTRL + ALT + PAGE DOWN) will just flip between next/previous windows.
--
In VS 2019, they aren't able to port the Custom Document Well extension so you'll have to vote for this feature to be added to Visual Studio instead.
--
I don't have VS 2008, so I'm not sure if the path to get to those setting is exactly the same. If you are unable to find it, you should be able to install Productivity Power Tools from the Extensions and Updates module (also located under TOOLS).
Hope that helps!
It is not perfect but the downward-pointing triangle just to the left of the X that closes the current editor tab does display all currently opened files in alphabetical order.
I use ReSharper's "Go To...":
(source: jetbrains.com)
Use the VS Studio extension "Sort Tabs/Open Editors by name" by omagerio.
Close all your tabs.
Go to this extension settings and uncheck "Sort by full path"
I always switch VS from Tabs to MDI. With tabs on, after working for a while there are so many documents the tab bar gets meaningless.
I use Resharper and Ctrl-T with CamelCase(CC) to get to my classes, or a simple old-fashioned Ctrl-Tab.

What are your most-recommended Visual Studio preferences? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
There are so many little options and settings within Microsoft Visual Studio. Which adjustments do you recommend to others?
Line Numbers
Tools > Options
Text Editor > All Languages > General
Display: Line Numbers
Environment->General->Animate environment tools => OFF.
Speeds UI responsiveness by 82%.
I've never found dynamic help to be either dynamic or helpful, and just tends to slow visual studio down, so using regedit:
registry key:
HKEY_CURRENT_USER\Software\Microsoft\Visual Studio\x.x\Dynamic Help
value:
Never Show DH on F1 = yes
I'm also keen on setting the following in Options->Projects and Solutions:
Show Output window when build starts - checked
(IMHO easiest way to spot build errors)
Track Active Item in Solution Explorer - unchecked
(stops every project ending up fully expanded in Solution Explorer)
Gotta have the tab indention set up right.
Also, Consolas & Color Themed - white backgrounds hurt my eyes
Option Strict On
Tools > Options
Projects and Solutions > VB Defaults
Default project settings: Option Strict: On
Tools -> Options -> Environment -> Keyboard
Setup a shortcut to close the active document. Ctrl+Alt+W in my case.
Personally i hate that VS defaults to "Tab to Spaces" when you are developing in C#. This is so awkward to work with and unnecessary.
Yes, i know there are issues with Tabs but honestly, did any of you ever encounter them coding in C# on Windows?
Several have mentioned custom keybindings. Here are handy default keybinding reference posters…
Microsoft Visual Basic Default Keybindings reference poster
A high quality, print-ready PDF
containing the useful keybindings for
developers that choose the Visual
Basic developer profile in Visual
Studio 2008 or use Visual Basic
Express.
Microsoft Visual C# Default Keybindings reference poster
Visual C# in Visual Studio 2008 and
Visual C# 2008 Express Edition Wall
chart showing useful keyboard
shortcuts for Visual C# programming
language.
I like Microsoft's instructions:
Download and extract PDF
Send to favorite full color printer/copier
Hang on wall
Code
Smile
Set the active document you're working on to display in the solution explorer. I've seen a lot of people hunting for their current doc if the project gets too big.
Tools -> Options.
Make sure show all settings is checked.
Click on Projects and Solutions.
Enable the Track Active Item in Explorer checkbox.
alt text http://img370.imageshack.us/img370/4821/trackactivedocumentqv2.gif
Environment => General => Recent files
24 items shown in Window menu
24 items shown in recently used lists
Environment => General
Show status bar ON
Animate environment tools OFF
Prevent Visual Studio from renaming pasted controls
How do I prevent Visual Studio from renaming my controls?
Window Layouts
This really isn't a setting but something I always do is back up my settings via Tools > Import and Export Settings.
I make sure to back up my window layouts for both single and multiple monitors. It saves frustration when moving from my multi-monitor setup to a single monitor for a presentation.
Not to mention, it makes it easy to get up and running on a new PC.
Visible white space. (Edit -> Advanced -> View White Space)
The default color is too strong. I immediately change it to silver. (Tools -> Options -> Fonts and Colors -> Visible White Space).
On some displays, even silver is too strong, and I create a "light silver".
I'm somewhat surprised to be the first person recommending Visual Studio Hacks for a lot of suggestions of this variety
Fixedsys Font
Tools > Options
Environment > Fonts and Colors
Font: Fixedsys
Always show solution
Tools > Options
Projects and Solutions
Always show solution
Check out this thread for the Color theme options for Visual Studio
https://stackoverflow.com/questions/141371/which-visual-studio-color-theme
And consolas is my favourite font
This applies to winform projects.
Instead of opening the form in design mode by default, you can configure VS to open the code editor instead. This is configured by right-clicking on a form in the solution explorer and choosing the "Open with" option. This gives you a dialog that allows you to specify the default option when double-clicking on a file.
In a control's properties, setting GenerateMembers to false for items you don't need (labels, etc). It's not a specifically Visual-Studio thing, more related to the platform, but mixed with the contextual list of objects and functions, it just clears up so much clutter.
When designing a form:
View > Tab Order
Allows you you specify and control your TabIndexes easily (much more so than setting them by hand!)
Source View
Tools > Options
HTML Designer > General
Start pages in: Source View
Its all about Resharper ;) Gives you tons of shortcuts which are so useful I can no longer work without them. I don't get on with the intellisense though, so I've turned that off.
This is incredibly useful, allows you to write underscores with the space bar when writing long test method names.
Un-Bold Brace Matching
Tools > Options
Environment > Fonts and Colors
Display items: Brace Matching (Hilight)
uncheck Bold
Find and Replace window’s "Search Hidden Text" checkbox.
It's not really a preference but it is indispensable. It sure is frustrating when you don’t notice that it "magically" unchecked itself.
Besides, Line Numbers, the first thing I always do in a newly-installed IDE is set the Edit.GoToDefinition keyboard shortcut.
Tools > Options > Keyboard

Resources