VS 2012: Scroll Solution Explorer to current file

FileVisual Studio-2012Solution Explorer

File Problem Overview


VS2010 had the feature that viewing a file would automatically cause Solution Explorer to scroll to that file.

With VS2012, viewing different files from within the IDE no longer scrolls and select the file in Solution Explorer automatically.

Is it possible to get this feature back? Is there a setting somewhere? If so, how/where?

File Solutions


Solution 1 - File

Yes, you can find that under > Tools - > Options - > Projects and Solutions - > Track Active Item in Solution Explorer

It's off by default (as you've noticed), but once it's on, Solution Explorer will expand folders and highlight the current document as you switch between files.

Solution 2 - File

If you need one-off sync with the solution pane, then there is new command "Sync with Active Document" (default shortcut: Ctrl+[, S). Explained here: Visual Studio 2012 New Features: Solution Explorer

Solution 3 - File

If you have ReSharper installed clicking Shift+Alt+L will move focus to the current file in Solution Explorer.

Active Item Tracking will also need to be enabled as described in the accepted answer

> Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer

Solution 4 - File

There are many ways to do this:

Go to current File once:

  • Visual Studio 2013

VS 13 has it's own shortcut to do this: Ctrl+</kbd>, S (Press Ctrl + </kbd>, Release both keys, Press the S key)

You can edit this default shortcut, if you are searching for SolutionExplorer.SyncWithActiveDocument in your Keyboard Settings (Tools->Options->Enviornment->Keyboard)

In addition there is also a new icon in the Solution Explorer, more about this here.

Sync with Active Document Button in VS2013 - Solution Explorer

  • Visual Studio 2012

If you use VS 2012, there is a great plugin to add this new functionality from VS2013 to VS2012: . The default shortcut is strg + alt + ü. I think this one is the best, as navigating to the solution explorer is mapped to strg + ü.

  • Resharper

If you use Resharper try Shift+Alt+L

This is a nice mapping as you can use Strg+Alt+L for navigating to the solution explorer

Track current file all the time:

  • Visual Studio >= 2012:

If you like to track your current file in the solution explorer all the time, you can use the solution from the accepted answer (Tools->Options->Projects and Solutions->Track Active Item in Solution Explorer), but I think this can get very annoying in large projects.

Solution 5 - File

If you don't have ReSharper installed and still want to use the shortcut Shift+Alt+L to move focus to the current file in Solution Explorer in Visual Studio 2013 then please follow these steps:

  1. Go to Tools->Options and search for "Keyboard" in the Search Options textbox:

enter image description here

  1. In the Show commands containing box type "solutionexplorer" and then in the list below look for the SyncWithActiveDocument command: enter image description here

  2. Click in textbox under "Press short keys" label and press: Shift+Alt+L and click the Assign button and you are done: enter image description here

To verify open any file in Visual Studio and press the shortcut keys Shift+Alt+L and you'll see the file in the solution explorer. Enjoy!

Solution 6 - File

It is possible in VSS by three ways.

  1. You can click on Active sync icon on Solution Explorer.

VSS Active sync with icon in solution Explorer

  1. By selecting Active sync checkbox in Tools (Tools > Options > Projects and Solutions > General). In that check the Track Active Item in Solution Explorer Checkbox. When you select a file in the main window, it will automatically navigate to active file in the Explorer.

VSS_Tools_Active_sync

  1. By using the Shortcut key (Ctrl + [ + S), you can able to navigate to active Item.

Note: Either 1 or 2 only works in a mean time.. So You have to use either 1st or 2nd.

Solution 7 - File

I've found the Sync with Active Document button in the solution explorer to be the the most effective (this may be a vs2013 feature!)

enter image description here

Solution 8 - File

On Visual Studio 2017, the shortcut is: Ctrl+´,S.

enter image description here

Solution 9 - File

Visual Studio 2019

Tools => Options

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSarah WeinbergerView Question on Stackoverflow
Solution 1 - FileChris Bowen - MSFTView Answer on Stackoverflow
Solution 2 - FileAlex BlekhmanView Answer on Stackoverflow
Solution 3 - FileRob WillisView Answer on Stackoverflow
Solution 4 - FileDavid LeitnerView Answer on Stackoverflow
Solution 5 - FileBaigView Answer on Stackoverflow
Solution 6 - FileNandhakumar MVView Answer on Stackoverflow
Solution 7 - FileTrubsView Answer on Stackoverflow
Solution 8 - FileIgorView Answer on Stackoverflow
Solution 9 - FileAli AdraviView Answer on Stackoverflow