Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: Shortcut to scroll solution explorer to current file

I'm not asking for the option to automatically follow the current file in the solution explorer. This has been answered in this question and I have this option turned off because I hate the behavior.

I would like to have a shortcut (or macro, or ....) to jump to the file I'm currently editing in the solution explorer.

like image 202
Laoujin Avatar asked Feb 18 '13 13:02

Laoujin


People also ask

How do I show the current file in Solution Explorer?

In Visual Studio's menu go to Tools > Options > Projects and Solutions. Then check "Track Active Item in Solution Explorer".

How do I navigate the Solution Explorer in Visual Studio?

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

What is Ctrl Shift F in Visual Studio?

Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.

How do I switch between files in Visual Studio?

To switch to specific files in the editorIn the upper right corner of the editor, choose the Active Files button, and then select a file from the list to switch to. On the menu bar, choose Window > Windows. In the list, select the file you want to view and then choose Activate.


2 Answers

In VS 2013 there is a built-in keyboard shortcut (CTRL+\, S)

  1. Press CTRL+backslash
  2. Release both keys
  3. Press the S key

Or click the button highlighted in the image bellow.

Sync with active document

One also has the option to customize the keyboard shortcut if you don't like the default combination :)

like image 115
moander Avatar answered Sep 18 '22 15:09

moander


In Visual Studio 2015, 2017 and 2019 you can press Ctrl + [ and then s.

This will highlight the file currently being edited in Solution Explorer.

This can be configured via the following keyboard command: SolutionExplorer.SyncWithActiveDocument

To reconfigure, navigate to Tools -> Options -> Environment -> Keyboard

like image 30
Adrian Thompson Phillips Avatar answered Sep 19 '22 15:09

Adrian Thompson Phillips