简体   繁体   English

在Visual Studio中,按名称查找和命令?

[英]In Visual Studio, find and commands by name?

I'd like to use the keyboard more in Visual Studio, and my memory for ctrl+alt+f??, alt+?? 我想在Visual Studio中更多地使用键盘,而我的内存用于ctrl+alt+f??, alt+?? key combinations is failing me. 组合键让我失望。

I'd prefer an adjunct like the emacs model, where it's possible to search commands by name; 我更喜欢emacs模型之类的附件,它可以按名称搜索命令; For instance, in emacs you type 例如,在emacs中键入

alt+x enab <tab><tab>

and it presents you with a list of commands starting 'enab'; 并为您显示以'enab'开头的命令列表;

enable-command
enable-flow-control
enable-theme

I'd like to know if there is a shortcut or extension so that I could do something similar in VS, like 我想知道是否有快捷方式或扩展名,以便可以在VS中做类似的事情,例如

alt+x imm <tab><tab>

and then choose to execute one of 然后选择执行以下一项

Debug.Immediate
Tools.ImmediateMode

Any clues? 有什么线索吗?

EDIT 编辑

Both @Trillian and @the_mandrill have given me the right answers. @Trillian和@the_mandrill都给了我正确的答案。 It turns out there are two ways to enter the kind of mode I'm looking for; 事实证明,有两种方法可以进入我要寻找的模式;

1) The Edit.GoToFindCombo , which gives you a small bit of menu-bar space to type things like 1) Edit.GoToFindCombo ,它为您提供了一些菜单栏空间来键入类似

>Debug.Immediate

2) The View.CommandWindow , which gives you a full panel (like the immediate window or the output window) which allows you to type in a bit more space and see the text output of executed commands. 2) View.CommandWindow ,它为您提供了一个完整的面板(例如即时窗口或输出窗口),使您可以输入更多的空间并查看已执行命令的文本输出。

It's also possible to alias commands in either window yourself, using the command window and a syntax like 也可以使用命令窗口和类似如下的语法自己在任何一个窗口中别名命令

alias sol View.SolutionExplorer

And to retrieve the current list like 并像检索当前列表

alias

I've mapped Edit.GoToFindCombo to alt-x and View.CommandWindow to alt-shift-x and it's feelimg more emacs-y already :) 我已经将Edit.GoToFindCombo映射到alt-x并将View.CommandWindow映射到alt-shift-x ,已经感觉到更多的emacs-y了:)

It would be nice if this was integrated in the Ctrl+Q Quick Launch box. 如果将其集成在Ctrl + Q Quick Launch框中,那就太好了。 Until then, the best built-in tool for this is probably the Go To Find Combo . 在此之前,最好的内置工具可能是Go To Find Combo You can use this to launch arbitrary commands by typing the '>' character and then the beginning of a Visual Studio command, including those you listed. 您可以使用它来启动任意命令,方法是先键入'>'字符,然后键入Visual Studio命令的开头,包括您列出的命令。 You get autocompletion, but only for strings that start with what you're typing, so >Deb would list you all commands starting with Debug. 您将获得自动补全功能,但仅适用于以您键入的内容开头的字符串,因此>Deb会列出所有以Debug.开头的命令Debug. . For your specific example, >imm would actually work because there is an immed shortcut to Debug.Immediate , but in general you'll have to know the prefix. 为了您的具体的例子, >imm将实际工作,因为有一个immed捷径Debug.Immediate ,但一般你必须知道的前缀。

The Go To Find Combo is not in the VS2013 UI by default, but you can add it to any toolbar by selecting "Customize" and finding the command in the "Edit" category. 默认情况下,“转到查找组合”不在VS2013 UI中,但是您可以通过选择“自定义”并在“编辑”类别中找到命令将其添加到任何工具栏中。 Once it's sitting in a toolbar, the Ctrl+/ shortcut will give it the focus by default. 一旦将其放置在工具栏中,默认情况下,Ctrl + /快捷键将使其成为焦点。

The '>' prefix for command completion also works from the Command and Immediate windows. 命令完成的“>”前缀也可以在“命令”和“立即”窗口中使用。

Try using the Command Window (Ctrl-Alt-A). 尝试使用命令窗口(Ctrl-Alt-A)。 This brings up an emacs-like command buffer. 这将弹出一个类似于emacs的命令缓冲区。 Type: 类型:

Deb.Imm<tab>

to expand to Debug.Immediate . 扩展到Debug.Immediate Typing the '.' 键入“。” forces autocompletion if there's one unique command (Debug is the only match for 'De'). 如果有一个唯一的命令,则强制自动补全(Debug是“ De”的唯一匹配项)。 Tab key will cycle through options. Tab键将在选项之间循环。 More info at the Command Window article on MSDN. 有关MSDN上“ 命令窗口”文章的更多信息。 There's also a list of Aliases that you can also add your own to, eg 还有一个别名列表,您也可以添加自己的别名。

alias di Debug.Immediate

I've also just discovered that you can type Ctrl-\\ to set the focus to the Find pane and enter a command directly in there. 我还发现您可以键入Ctrl-\\将焦点设置到“查找”窗格,然后直接在其中输入命令。

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

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