.net 用于关闭除 Visual Studio 中当前选项卡之外的所有选项卡的键盘快捷键?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/97279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Keyboard shortcut to close all tabs but current one in Visual Studio?
提问by Ted
Does anyone know a keyboard shortcut to close all tabs except for the current one in Visual Studio? And while we're at it, the shortcut for closing all tabs? Is there a Resharper option for this? I've looked in the past and have never been able to find it.
有谁知道关闭所有选项卡的键盘快捷键,除了 Visual Studio 中的当前选项卡?当我们这样做时,关闭所有选项卡的快捷方式?是否有 Resharper 选项?我过去看过,一直找不到。
回答by Aaron Jensen
I don't think there is one by default, but you can go to Tools>Options>Environment>Keyboard and bind a key to File.CloseAllButThis.
我认为默认情况下没有,但您可以转到工具>选项>环境>键盘并将一个键绑定到 File.CloseAllButThis。
I use ctrl+alt+w
我用ctrl+ alt+w
回答by Drew Noakes
By default, the command File.CloseAllButThisdoes not have a keyboard binding. You can set one up yourself though, as shown here:
默认情况下,该命令File.CloseAllButThis没有键盘绑定。不过,您可以自己设置一个,如下所示:


In this example, I'm going to map CTRL+ SHIFT+ ALT+ Wto File.CloseAllButThisin global scope. You may like to set the scope to only the text editor.
在这个例子中,我要地图CTRL+ SHIFT+ ALT+ W,以File.CloseAllButThis在全球范围内。您可能希望将范围设置为仅文本编辑器。
I close all documents using ALT+ W+ L.
我关闭使用的所有文档ALT+ W+ L。
This is available in Visual Studio without any special plugins or configuration. It just uses the tool bar mnemonics. The corresponding command is Window.CloseAllDocumentsin case you wish to bind it to something else.
这在 Visual Studio 中可用,无需任何特殊插件或配置。它只是使用工具栏助记符。Window.CloseAllDocuments如果您希望将其绑定到其他内容,则使用相应的命令。
回答by Anderson Fortaleza
Quick answer: ALT+-+A
快速回答:ALT+ -+A
Tested on Visual Studio 2013. On the window that you want to keep open press ALT+-, this will open the window top left menu, then press Ato close all windows but the current one.
在 Visual Studio 2013 上测试过。在要保持打开的窗口上按ALT+ -,这将打开窗口左上角的菜单,然后按A关闭除当前窗口之外的所有窗口。
回答by pdavis
There isn't a keyboard shortcut by default but you can bind it to a keyboard shortcut in the general environment settings (Options->Environment->Keyboard), the command is File.CloseAllButThis.
默认情况下没有键盘快捷键,但您可以将其绑定到通用环境设置(选项->环境->键盘)中的键盘快捷键,命令为 File.CloseAllButThis。
回答by Ilya Ryzhenkov
If you find yourself using "Close all but this" too often, you can also try Tools \ Options \ Environment \ Documents \ [x] Reuse current document window, if saved. Combined with ReSharper's Recent Edits (ctrl-, or ctrl-e depending on keymap) you can avoid having too much open documents all the time and still quickly navigate between recently opened.
如果您发现自己过于频繁地使用“关闭除此之外的所有内容”,您还可以尝试工具 \ 选项 \ 环境 \ 文档 \ [x] 重用当前文档窗口(如果已保存)。结合 ReSharper 的“最近编辑”(ctrl- 或 ctrl-e,取决于键盘映射),您可以避免一直打开过多的文档,并且仍然可以在最近打开的之间快速导航。
回答by Micky McQuade
Sara Ford has a lot of tips like these about Visual Studio
Sara Ford 有很多关于 Visual Studio 的提示
Here's one that references what aaronjensen said about File.CloseAllButThis:
这里引用了 aaronjensen 所说的关于 File.CloseAllButThis 的内容:
回答by erikH
In order to close all documents:
要关闭所有文档:
Tools->Customize...->Keyboard..->Environment->Keyboard
工具->自定义...->键盘..->环境->键盘
There I've mapped command Window.CloseAllDocuments to Alt+Ctrl+F4
我已经将命令 Window.CloseAllDocuments 映射到 Alt+Ctrl+F4
回答by Chasler
I follow aarojensen's method, but put it in the file menu (right click on the menu and select customize). Then Alt-F-B closes all but the current.
我遵循aarojensen的方法,但将其放在文件菜单中(右键单击菜单并选择自定义)。然后 Alt-FB 关闭除当前之外的所有内容。

