VS 2012:將解決方案資源管理器滾動到當前文件

本文翻譯自:VS 2012: Scroll Solution Explorer to current file

VS2010 had the feature that viewing a file would automatically cause Solution Explorer to scroll to that file. VS2010具有查看文件會自動導致解決方案資源管理器滾動到該文件的功能。

With VS2012, viewing different files from within the IDE no longer scrolls and select the file in Solution Explorer automatically. 使用VS2012,從IDE中查看不同的文件不再滾動並自動在解決方案資源管理器中選擇該文件。

Is it possible to get this feature back? 有可能恢復此功能嗎? Is there a setting somewhere? 某處有設置嗎? If so, how/where? 如果是這樣,怎麼/在哪裏?


#1樓

參考:https://stackoom.com/question/rDKy/VS-將解決方案資源管理器滾動到當前文件


#2樓

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. 它默認是關閉的(正如您所注意到的),但一旦打開,解決方案資源管理器將展開文件夾並在文件之間切換時突出顯示當前文檔。


#3樓

If you need one-off sync with the solution pane, then there is new command "Sync with Active Document" (default shortcut: Ctrl + [ , S ). 如果您需要與解決方案窗格進行一次性同步,則會出現新命令“與Active Document同步”(默認快捷鍵: Ctrl + [S )。 Explained here: Visual Studio 2012 New Features: Solution Explorer 這裏解釋: Visual Studio 2012新功能:解決方案資源管理器


#4樓

If you have ReSharper installed clicking Shift + Alt + L will move focus to the current file in Solution Explorer. 如果安裝了ReSharper,請單擊Shift + Alt + L將焦點移至解決方案資源管理器中的當前文件。

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 工具 - >選項 - >項目和解決方案 - >在解決方案資源管理器中跟蹤活動項


#5樓

There are many ways to do this: 有很多方法可以做到這一點:

Go to current File once: 轉到當前文件一次:

  • Visual Studio 2013 Visual Studio 2013

    VS 13 has it's own shortcut to do this: Ctrl + \\ , S (Press Ctrl + \\ , Release both keys, Press the S key) VS 13有自己的快捷方式: Ctrl + \\S (按Ctrl + \\ ,釋放兩個鍵,按S鍵)

    You can edit this default shortcut, if you are searching for SolutionExplorer.SyncWithActiveDocument in your Keyboard Settings (Tools->Options->Enviornment->Keyboard) 如果要在Keyboard Settings中搜索SolutionExplorer.SyncWithActiveDocument (工具 - >選項 - >環境 - >鍵盤),則可以編輯此默認快捷方式

    In addition there is also a new icon in the Solution Explorer, more about this here . 此外,解決方案資源管理器中還有一個新圖標, 此處有更多相關信息。

    在VS2013中與Active Document按鈕同步 - 解決方案資源管理器

  • Visual Studio 2012 Visual Studio 2012

    If you use VS 2012, there is a great plugin to add this new functionality from VS2013 to VS2012: . 如果你使用VS 2012,有一個很棒的插件可以將這個新功能從VS2013添加到VS2012 :. The default shortcut is strg + alt + ü . 默認快捷方式是strg + alt + ü I think this one is the best, as navigating to the solution explorer is mapped to strg + ü . 我認爲這是最好的,因爲導航到解決方案資源管理器映射到strg + ü

  • Resharper ReSharper的

    If you use Resharper try Shift + Alt + L 如果您使用Resharper,請嘗試Shift + Alt + L.

    This is a nice mapping as you can use Strg + Alt + L for navigating to the solution explorer 這是一個很好的映射,因爲您可以使用Strg + Alt + L導航到解決方案資源管理器

Track current file all the time: 始終跟蹤當前文件:

  • Visual Studio >= 2012 : 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. 如果您希望始終在解決方案資源管理器中跟蹤當前文件,可以使用已接受答案中的解決方案(工具 - >選項 - >項目和解決方案 - >在解決方案資源管理器中跟蹤活動項目),但我認爲這可以在大型項目中變得非常討厭。


#6樓

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!) 我發現解決方案資源管理器中的“ Sync with Active Document按鈕是最有效的(這可能是vs2013功能!)

在此輸入圖像描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章