166

Is there a keyboard shortcut in Visual Studio (aside from CTRL+TAB and selection) that would take me from inside a document directly into the solution explorer? I don't want to customize any shortcuts or change any default behavior.

4
  • See: www.visualstudioshortcuts.com/2012/ (Though 2010 version is not available, it is still very useful).
    – Chris W
    Feb 16, 2017 at 14:09
  • @stepanian fair point on primacy if this is earlier. I just meant duplicate i.e. they are the same. I was just linking them up for those doing admin. Mar 7, 2019 at 5:03
  • @stepanian also I answered on this question not that - as I saw the date was earlier. Thanks Mar 7, 2019 at 5:04

13 Answers 13

270

CTRL+ALT+L

should shift focus to the Solution Explorer.

For visual studio 2012 use:

CTRL+[ + S this selects your current document in the solution explorer.

5
  • 1
    Thanks! And I assume ctrl + alt + l and then select the file with an arrow to come back?
    – stepanian
    Jun 4, 2011 at 18:57
  • 8
    Yup, press Enter to select the file, or Escape to just jump back to the document window without selecting the file :)
    – keyboardP
    Jun 4, 2011 at 18:58
  • It also seems like ctrl + tab brings you back to the initial document with it selected (saving you the enter key press). Every second counts!
    – stepanian
    Jun 4, 2011 at 19:01
  • Oh sorry, by selected I thought you meant actually opened. Escape will return to document, whilst keeping the selection, but it won't open the file. (Similar to ctrl + tab). Enter will actually open the file.
    – keyboardP
    Jun 4, 2011 at 19:05
  • 1
    In VS 2015, you can select "View" from the toolbar menu to see all the direct shortcuts for shifting focus to different windows. The same tricks (Escape, Enter) work for all of these.
    – Sitric
    Dec 28, 2015 at 18:52
53

When using VS 2012 with the Visual C# 2005 keyboard mapping scheme:

CTRL+W, S

I find this easier to memorize: All shortcuts beginning with CTRL+W are for opening or navigating to W indows:

  • CTRL+W, S: S olution Explorer
  • CTRL+W, E: E rror list
  • CTRL+W, R: R esourceview
  • CTRL+W, A: Command window (A ction ...)
  • CTRL+W, T: T askview
  • CTRL+W, Q: Find Symbol Results
  • CTRL+W, X: Toolbo x
  • CTRL+W, C: C lassview
  • CTRL+W, P: P roperties
  • CTRL+W, B: B ookmarks
  • ...
1
  • Thank you for precising the keyboard mapping scheme ! I've been looking for using the shortcut Ctrl+W+S for the solution explorer since i installed a new VS2012 !
    – hemma731
    May 14, 2014 at 10:07
23

In Visual Studio 2012 you can now use CTRL+; as this is the default keyboard shortcut for the solution explorer search box.

1
  • 5
    Ctr+' opens team explorer. Ctrl + , opens "file selector".. Pretty handy shortcuts.
    – arviman
    Nov 13, 2014 at 12:33
14

On my windows 7 machine : Ctrl+ALT+L locks the computer.

For me : Shift+ALT+L works. (This could also be a resharper configuration)

1
  • Yes, Shift + Alt + L is resharper
    – Rory
    Dec 17, 2020 at 19:46
13
  1. shortcut ctrl [, S will focus current open file/document in solution explorer.
  2. setting checkbox to true in "Track active in Solution Explorer" will automatically focus current open file/document in solution explorer (Tools->Options->Projects and solutions->General->"Track Active Item in Solution Explorer"=true
0
12

The default keyboard shortcut for opening/jumping to Solution Explorer is Ctrl + Alt + L.

10

Extended above : command name for sync tab with solution explorer is "SolutionExplorer.SyncWithActiveDocument"

1
  • what monsters. How completely undiscoverable is that? You saved me ages <3. Dec 1, 2022 at 10:14
6

Visual Studio

2015 and 2017 (by default) VS 2017 Shortcuts

Ctrl + [, S

Runs Keyboard Shortcut

SolutionExplorer.SyncWithActiveDocument

ReSharper

In Visual Studio 2015 and 2017 (by default) Resharper Docs

Shift + Alt + L

Which runs Resharper's Keyboard Shortcut

Resharper.Resharper_LocateInSolutionOrAssemblyExplorer

Both

  • Focus Solution Explorer
  • Highlight document
  • Scroll / expand nodes (as required to show that document)

Difference

Resharper's version also works with decompiled code. Locating decompiled symbols in the Assembly Explorer window.

To customise / it doesn't work :

  1. Tools > Options > Environment > Keyboard
  2. Search shortcut name (e.g. SolutionExplorer.SyncWithActiveDocument)
  3. Assign (in TextEditor) to Keyboard shortcuts as you like

(N.B. I used to use Global, but VS2022 + Resharper seemed to only accept either binding if was set in TextEditor not Global)

3

I had this problem on a new machine build with VS 2013 and R# 8.2.

Keyboard option Resharper.Resharper_LocateInSolutionExplorer was correctly set to Shift+Alt+L, but it seemed to be only opening a parent folder and not selecting the actual file. As recommended in another post I enabled "Track active in Solution Explorer" in the VS Options.

This didn't fix the problem and wasn't what I want because in very large solutions I don't want the solution explorer jumping around to the current file in use. I disabled the Track feature and restarted VS, the LocateInSolutionExplorer feature then started working correctly. Some sort of shortcut precedence issue?

3

ctrl + [ + S.

This shortcut will highlight the currently opened document in solution explorer.

2

For AZERTY keyboards like mine, the default shortcut is Ctrl+), Ctrl+S

1

Ctrl+Alt+L works fine even in VS 2019.

But if you have reassigned the above key to some other command (by mistake in my case) then the name of the command is View.SolutionExplorer

You can search it in the Tools -> Options -> Environment -> Keyboard or just do Ctrl+Q and search keymap.

And then search View.SolutionExplorer in the Show commands containing: and assign whichever key you want.

enter image description here

0

We just upgraded from VS2013 to VS2017, and I had to go looking for how to auto-select the active tab in the Solution Explorer. I often have to look for a document by finding a text-string from a screen, and love to have it select the document so I can see where it is.

Tracking the active document has been default behavior for a long time. VS2017 brought over ALL my other preferences, but not this one. Glad I found this thread--Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.