In Visual Studio 2010, is there a way to keep recently-used files from falling off the File Tab Channel? - visual-studio

In Visual Studio 2008 you could use Sara Ford's did you know #331 (Did you know… You can keep recently-used files from falling off the File Tab Channel? - #331) to make the tabs ordered in MRU (most recently used) order (i.e. the current window is always the left most tab, the previously visited window is second tab, and so forth).
The registry entry listed in the blog post does not appear to work in VS2010 and I have not figured out a way to get tabs listed in MRU. Does anyone know if there is a way in Visual Studio 2010 to keep the most recently-used file from falling off the File Tab Channel?

In the "Productivity Power Tools" extension, the Remove Tabs By Usage Order option seems to be what you are looking for.

Try installing the "Productivity Power Tools" extension - you can disable any other features that you don't use, but the customisation of the tab well is very useful. I don't think it does MRU order, but there are a number of other options that might help.

Another solution, if you are using Windows 7, would be to pin VS2010 to the task bar and then pin them to the programme tasks bar within that through drag and drop for instance.

Related

Is there a way to automatically collapse the Script Documents section in solution explorer?

While in debug mode, the solution explorer has a Script Documents section. It is expanded by default. As the debugger runs, new ScriptDocumentxxx poll.txt files are added to this section. As I am navigating the explorer files, the adding of these new line items causes the entire contents of the explorer to shift downward. This is quite annoying if I am trying to find a file or trying to click something. I can collapse the section manually, but I'd rather not have to do this all of the time.
Right click the projects you are interested in working on and click on 'Scope to this'. This will hide everything (Including the scripts folder) except those projects you selected.
I got annoyed enough with this that I turned off JavaScript debugging. If you are willing to go that far, the scripts are gone.
The path for turn of JS debugging is:
Tools -> Options -> Debugging -> General -> Enable JavaScript debugging for ASP.NET (Chrome, Edge and IE) (Visual Studio 2017 and 2019)
Note: This method does not prevent you from stepping though JS in the Chrome inspection tools so you do not lose that ability. You lose both the scripts (of course) and that new Chrome window that pops up when you launch the debugger.
Yes, there is.
IIS Express > Script Debugging > Disabled
Right click then 'Scope to This' to hide everything but the project in the solution you want to view.
Click on the Home/House icon to reverse it.
Yes there is. One way is to create a visual studio add-in or extension which monitors the solution explorer tree and collapses the "script documents" -item if it is expanded.
If you need code samples and/or a fully functional add-in just let me know. You have Visual Studio 2013, ay? Is it the express edition or what?
This is confirmed bug in VS 2019. Just Microsoft is not so fast about fixing it.
https://developercommunity.visualstudio.com/content/idea/351537/provide-a-way-to-prevent-the-script-documents-fold.html

How do I pin a tabbed document in Visual Studio 2010?

Is there any way to "pin" a document into a fixed position? I want to keep the "Source Control Explorer" tab on the far left and always open new documents to the right of it.
However, VS 2010 tends to add documents at the very left. I want "Source Control Explorer" on the very far left so I always know where to find it.
I can think of two different ways of doing this. The first one uses only options that are built into Visual Studio 2010 but is more limited and may not work 100% of the time. The other one requires that you install an extension, but is much more powerful, dependable, and even adds some other useful features.
You can configure Visual Studio to always open new tabs to the right of existing tabs, just like a web browser would. (Personally, I prefer this option.) To do this, open the options dialog (Tools → Options), expand the "Environment" category, click on "Documents" and check the "Insert documents to the right of existing tabs" box (see screen shot).
The key to making this work for you is to ensure that you always open the Source Control Explorer first before opening any other code windows, and then never close it. That way, it will always be on the far left, and all of the code windows you open will be inserted to the right of it.
Like I mentioned above, the advantage of this approach is that it uses a setting built into Visual Studio and doesn't require that you install anything extra. All you have to do is flip a switch. The disadvantage is that it isn't 100% dependable—if you close the Source Control Explorer and re-open it, you'll have to remember to drag it back into position at the far left or it won't be there when you go to look for it.
You can install Microsoft's Productivity Power Tools extension (available from the Visual Studio gallery), which adds the ability to pin tabs (among lots of other neat features) to the VS IDE. There's a great run-down of the features added specifically to the document tab well here, but the feature you're most interested in is pinned tabs. You can even show pinned tabs in a separate row!
This is as close to a perfect solution as it gets, but it does have the disadvantage of requiring you to install something extra. In some environments and for some people, that can be a deal killer. Too many extensions can also slow things down, and later versions of Visual Studio often seem to be slow enough already. (Though, for what it's worth, I use the PPT extension on about half of my VS installations and I haven't noticed that it has caused any significant issues.)

How to locate a file in Solution Explorer in Visual Studio 2010?

I have a huge solution with multiple projects. Sometime I need to navigate to a file in Solution Explorer. Using the VS 2010 'Navigate To' feature I can open any file by name in Visual Studio 2010 but I want to be able to select the file in Solution Explorer as well?
There's an option to track the active (open and viewed) item in the solution explorer. If the file is in view, the file in the solution explorer will be selected.
Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer
VS2012 added a new command called SolutionExplorer.SyncWithActiveDocument. The default shortcut for c# is Ctrl+[,S
This command will navigate to the active file in the Solution Explorer.
Also, it seems that you need to have the "Track Active Item in Solution Explorer" option turned off.
With ReSharper installed Shift+Alt+L will find the current file in Solution Explorer in Visual Studio 2008+.
I found the track option to be a little annoying.
I prefer to use DPack. It contain "Locate In Solution Explorer" operation, plus many other features (some are less powerful in VS2010, like their browsers), and it's free.
Note that ReSharper also have the locate feature that works batter than DPack's (in some cases, DPack's locate won't work if the file is collapsed behind folders), but you don't want to buy ReSharper only for this feature.
Brian Schmitt has a great Locate File in Solution Explorer – Visual Studio Macro post for this. The macro is extremely simple and quick. Basically it toggles the setting
Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer
so that the current file ends up selected in the Solution Explorer but, because it is not left on, you don't get irritated by Solution Explorer nodes being expanded for all the files you access.
Public Sub LocateFileInSolutionExplorer()
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand("View.SolutionExplorer")
End Sub
Bind a Keyboard ShortCut to this custom macro to effectively create what should be a built-in Visual Studio feature.
If you have ReSharper and want to add "Locate in Solution Explorer" to the tab's context menu:
Go to Tools -> Customize -> Commands -> Context Menu
Select "Other Context Menus | Easy MDI Document Window".
Click "Add Command".
Choose "Resharper" -> "ReSharper_LocateInSolutionOrAssemblyExplorer" (in VS2019, the category name was changed to "Extensions")
"OK" -> "Close"
Now, when right click on any tab and you'll see a new option: Locate in Solution Explorer.
UPDATE:
Following the comment from #jeremy-paskali, you can set a keyboard shortcut for this command:
Go to Tools -> Customize -> "Keyboard..."
Search for "ReSharper.ReSharper_LocateInSolutionOrAssemblyExplorer" in the "Show commands containing" field and select it.
Review the currently assigned shortcuts in the drop down below.
Make any changes, if needed.
"OK" -> "Close"
Visual Studio 2012 has a new shortcut Ctrl [, S. Yes you have to type Ctrl [ and then release and then immediately type S (or click the little sync icon at the top of Solution Explored). It will synchronize to the item.
Of course you can change the shortcut. I think I'll try Alt+L for locate.
If you want to change the shortcut, it's command name under Options\Environment\Keyboard is SolutionExplorer.SyncWithActiveDocument.
Usually this is more useful than always tracking, which in older versions always was a disaster because it would track 100 items in a row and then be jumping all over the place...
I know its little too late, but hope it helps someone else. The best option now is to install Microsoft Visual Studio add on called - Productivity Power Tools.
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef
With this comes "Solution Navigator" (alternative to Solution Explorer, with a lot of benefits) - which then you can use to filter the files to only show "Open". You can even filter files to show "Edited" and "Unsaved".
In the event you want to only track the current file through a
keyboard shortcut - the activity is
"View.TrackActivityinSolutionExplorer" (assign keys here -> Tools -
Options - Environment - Keyboard)
Credit (James' comment)
This worked for me
There are several build-in ways you can accomplish this nowadays:
Configure VS to track the active item in Solution Explorer: This can be accomplished by selecting "Track active item in Solution
Explorer" at
Tools > Settings > Projects and Solutions > General
Use "Sync with active document": This can be accomplished in 2 ways.
Firing the SolutionExplorer.SyncWithActiveDocument command by using the default key combination CTRL+]+S
CTRL+)+S if you happen to be using an AZERTY keyboard like me.
By using the "Sync with active document" button on top of the Solution Explorer. The button looks like 2 apposing arrows on top of each other.
If you're version is older then VS2019 Version 16.10.2 then this button looks like this:
From VS2019 Version 16.10.2 onwards this button will look like this:
And yet again Microsoft has changed the button icon in more recent versions of VS 2022:
In Visual Studio 2010 you can turn on the "Track Active Item in Solution Explorer" option. This will mean whenever you switch between documents the new document gets selected in Solution Explorer. This can be irritating if your solution has lots of folders, because as you move around files in your solution all the folders will be left open.
Visual Studio 2012 introduced the new "Sync with Active Document" feature. Three is a button for it at the top of Solution Explorer, or you can use the shortcut Ctrl + [, S.
This is actually built in to visual studio without the need for ReSharper (which I love BTW).
http://blogs.msdn.com/b/zainnab/archive/2010/03/29/track-active-item-in-solution-explorer-vstipproj0011.aspx
If you want to select the file in the solution explorer on command and don't want to install anything then I would recommend this macro.
I've tested it, setting the shortcut to Alt+T, and I can confirm that it works with VS 2010.
Thanks to Dan Vanderboom for writing it.
For Visual Studio 2017 using a French AZERTY keyboard the command is the same as stated by Aaron Carlson but the keyboard shortcut is different.
The AZERTY keyboard shortcut to navigate to the active file for c# is Ctrl+),Ctrl+S
I checked the shortcut hadn't changed for QWERTY users in VS2017 on this page
http://visualstudioshortcuts.com/2017/
Visual Studio doesn’t offer an easy way to locate the current file you’re editing in the Solution Explorer on demand. You can set the solution explorer to always stay in sync with this simple setting:
Tools > Options > Projects and Solutions > General. Check “Track active item in Solution Explorer”.
Thanks to Cory House

VS2010 Only show file names in tabs

My website has several nested folders and sometimes long file names, so sometimes only 4 tabs can be opened at a time.
Can vs2010 be made to show only file names and leave out any path information?
Can the max displayed length for tabs be set?
I know the window can be split so top and bottom both have their own tabs.
For example (using the "Visual Studio 2010 Pro Power Tools"):
Showing the files:
...r.aspx.cs
...s.aspx.cs
...s.aspx.cs
...s.aspx.cs
...s.aspx.cs
For example (not using the Visual Studio 2010 Pro Power Tools):
Showing the files:
Adminstration/...quests.aspx.cs
Adminstration/...tUsers.aspx.cs
Adminstration/...ctions.aspx.cs
Adminstration/...eBanks.aspx.cs
Try installing the "Visual Studio 2010 Pro Power Tools" extension from the Extension Manager in VS. It adds a new section to the standard option dialogue that allows you to customise what they call the "Document Tab Well."
It doesn't let you truncate the filename, but you can change the way they draw and scroll, which might be enough to help.
It does allow more tabs at a time, but it severly shortens the amount of file name you see. So while it allows editing more files, you won't know what file you are editing.
For now I'm using the trial version of Tab Studio
In VS2010, go to Tools - Extension Manager. Go to the online gallery and search for this extension:
Visual Studio 2010 Pro Power Tools
This extension, once installed, gives you extensive control over the document well, including setting a max tab width and much more. I love this extension, and have had zero issues customizing tab behavior to suit my preferences. Hope this helps.
Fixed in Visual Studio 2012
This has finally been fixed in Visual Studio 2012:
So i see:
PendingRequests.aspx (rather than ...r.aspx.cs)
ImportUsers.aspx.cs (rather than ...s.aspx.cs)
SearchTransactions.aspx.cs (rather than ...ctions.aspx.cs)
ImportTimeBanks.aspx.cs (rather than eBanks.aspx.cs)
Now if we could just get the entire Visual Studio ecosystem to:
return to the use of Left, Right arrows to navigate overflow tabs
open new tabs on the right
just like Windows has been doing in 1994, and Visual Studio would start to almost become a user-friendly Windows application.
I have been using this excellent extension for VS2010 that solve your problems: Visual Studio 2010 Pro Power Tools.
It is a bundle of several extensions, but the most notable for you is the Document Well 2010 Plus. It allows you to configure the document tabs: to be the constant width, colour-coded by project, pinned, etc...
You can toggle the extensions that you do not want by editing the manifest file in:
~\Local Settings\Application Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\Visual Studio 2010 Pro Power Tools\
#IanBoyd: I agree, it doesn't solve the problem 100% however it helps (which is why most of the answers to this question suggest it). With the Visual Studio 2010 Pro Power Tools add-on you can a) set the maximum tab width using one tab options, b) setup some colour categorizing rules to help differentiate between projects/file types.
In VS2010, my workflow relies upon several add-ons and keyboard shortcuts to manage my workspace; for example I use CTRL + Tab to switch between active documents, use the pin-tab feature and colour coding from Power Pro Tools, the open solution file dialog from Visual Assist X, and re-open last edited file from Resharper.
This has been answered already here:
Remove path from tab name in Visual Studio 2010
Install the productivity power tools extension and it should do it by default!
Cheers.

What are some good usability addins for Visual Studio 2008?

I've been using Visual Studio for a long time and the constant shuffling of the code tabs at the top drives me bonkers. I was wondering if there were any add-ins that might change this or other UI behavior.
Things that might be cool:
Sticky Tabs that won't go away.
Multi-code file collapsible tabs (maybe each tab being a project?).
Having the solution tree go to the file you are currently looking at automatically. Thanks Omlette!
Your idea here.
I've done a bit of googling and haven't been able to find anything useful.
The "Having the solution tree go to the file you are currently looking at automatically" feature already exists in VS2008, but isn't enabled by default. Go to tools -> options -> projects and solutions -> general and check the "Track Active Item in Solution Explorer" box.
Rick,
Tabs Studio add-in for Visual Studio is a replacement for built-in tabs. Multiple rows of tabs make them always visible. Tabs can be grouped, it is probably close to what you call "multi-code file tabs".
See Tabs Studio home page for more information.

Resources