简体   繁体   English

Visual Studio - 导航到解决方案资源管理器的快捷方式

[英]Visual Studio - Shortcut to Navigate to Solution Explorer

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? Visual Studio 中是否有键盘快捷键(除了CTRL + TAB和选择)可以将我从文档内部直接带入解决方案资源管理器? I don't want to customize any shortcuts or change any default behavior.我不想自定义任何快捷方式或更改任何默认行为。

CTRL + ALT + L CTRL + ALT + L

should shift focus to the Solution Explorer.应该将焦点转移到解决方案资源管理器。

For visual studio 2012 use:对于视觉工作室 2012 使用:

CTRL + [ + S this selects your current document in the solution explorer. CTRL + [ + S这将在解决方案资源管理器中选择您当前的文档。

When using VS 2012 with the Visual C# 2005 keyboard mapping scheme :将 VS 2012 与Visual C# 2005 键盘映射方案一起使用时:

CTRL + W , S 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开头的快捷方式都用于打开或导航到W indows:

  • CTRL + W , S : S olution Explorer CTRL + WS解决方案资源管理器
  • CTRL + W , E : E rror list CTRL + W , E :错误列表
  • CTRL + W , R : R esourceview CTRL + WRR
  • CTRL + W , A : Command window ( A ction...) CTRL + WA :命令window (动作...)
  • CTRL + W , T : T askview CTRL + W , T : T
  • CTRL + W , Q : Find Symbol Results CTRL + WQ :查找符号结果
  • CTRL + W , X : Toolbo x CTRL + WX :工具箱x
  • CTRL + W , C : C lassview CTRL + W , C : C
  • CTRL + W , P : P roperties CTRL + W , P :属性
  • CTRL + W , B : B ookmarks CTRL + WB书签
  • ... ...

In Visual Studio 2012 you can now use CTRL + ;在 Visual Studio 2012 中,您现在可以使用CTRL + ; as this is the default keyboard shortcut for the solution explorer search box.因为这是解决方案资源管理器搜索框的默认键盘快捷键。

On my windows 7 machine: Ctrl + ALT + L locks the computer.在我的 windows 7 机器上: Ctrl + ALT + L锁定计算机。

For me: Shift + ALT + L works.对我来说: Shift + ALT + L有效。 (This could also be a resharper configuration) (这也可能是一个更清晰的配置)

  1. shortcut ctrl [ , S will focus current open file/document in solution explorer.快捷键ctrl [ , S将在解决方案资源管理器中关注当前打开的文件/文档。
  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在“解决方案资源管理器中跟踪活动”中将复选框设置为 true 将自动在解决方案资源管理器中关注当前打开的文件/文档(工具->选项->项目和解决方案->常规->“在解决方案资源管理器中跟踪活动项目”=true

The default keyboard shortcut for opening/jumping to Solution Explorer is Ctrl + Alt + L .打开/跳转到解决方案资源管理器的默认键盘快捷键是Ctrl + Alt + L

Extended above: command name for sync tab with solution explorer is " SolutionExplorer.SyncWithActiveDocument "上面扩展:与解决方案资源管理器同步选项卡的命令名称是“ SolutionExplorer.SyncWithActiveDocument

Visual Studio视觉工作室

2015 and 2017 (by default ) VS 2017 Shortcuts 20152017默认VS 2017 快捷方式

Ctrl + [ , S Ctrl + [ , S

Runs Keyboard Shortcut运行键盘快捷键

SolutionExplorer.SyncWithActiveDocument

ReSharper锐化器

In Visual Studio 2015 and 2017 (by default ) Resharper Docs在 Visual Studio 20152017中(默认Resharper Docs

Shift + Alt + L Shift + Alt + L

Which runs Resharper's Keyboard Shortcut哪个运行Resharper 的键盘快捷键

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 . Resharper 的版本也适用于反编译代码 Locating decompiled symbols in the Assembly Explorer window.Assembly Explorer window 中定位反编译的符号。

To customise / it doesn't work:自定义/它不起作用:

  1. Tools > Options > Environment > Keyboard工具 > 选项 > 环境 > 键盘
  2. Search shortcut name (eg SolutionExplorer.SyncWithActiveDocument)搜索快捷方式名称(例如 SolutionExplorer.SyncWithActiveDocument)
  3. Assign (in Global) to Keyboard shortcuts as you like根据需要(全局)分配给键盘快捷键

ctrl + [ + S . ctrl + [ + S

This shortcut will highlight the currently opened document in solution explorer.此快捷方式将突出显示解决方案资源管理器中当前打开的文档。

I had this problem on a new machine build with VS 2013 and R# 8.2.我在使用 VS 2013 和 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.键盘选项Resharper.Resharper_LocateInSolutionExplorer已正确设置为Shift+Alt+L ,但它似乎只是打开父文件夹而不选择实际文件。 As recommended in another post I enabled "Track active in Solution Explorer" in the VS Options.正如另一篇文章中所建议的那样,我在 VS 选项中启用"Track active in Solution Explorer"

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.我禁用了 Track 功能并重新启动了 VS,然后LocateInSolutionExplorer功能开始正常工作。 Some sort of shortcut precedence issue?某种捷径优先问题?

For AZERTY keyboards like mine, the default shortcut is Ctrl + ) , Ctrl + S对于像我这样的AZERTY键盘,默认快捷键是Ctrl + )Ctrl + S

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.我们刚刚从 VS2013 升级到 VS2017,我不得不 go 寻找如何在解决方案资源管理器中自动选择活动选项卡。 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.我经常需要通过从屏幕上查找文本字符串来查找文档,并且喜欢将它 select 文档,以便我可以看到它在哪里。

Tracking the active document has been default behavior for a long time.跟踪活动文档长期以来一直是默认行为。 VS2017 brought over ALL my other preferences, but not this one. VS2017 带来了我所有的其他偏好,但不是这个。 Glad I found this thread--Thank you.很高兴我找到了这个线程-谢谢。

Ctrl + Alt + L works fine even in VS 2019. Ctrl + Alt + L即使在 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但是,如果您已将上述键重新分配给其他命令(在我的情况下是错误的),那么命令的名称是View.SolutionExplorer

You can search it in the Tools -> Options -> Environment -> Keyboard or just do Ctrl + Q and search keymap .您可以在Tools -> Options -> Environment -> Keyboard中搜索它,或者只需执行Ctrl + Q并搜索keymap

And then search View.SolutionExplorer in the Show commands containing: and assign whichever key you want.然后在包含的Show commands containing:搜索View.SolutionExplorer :并分配您想要的任何键。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM