visual-studio Visual Studio - 管理许多打开文件的工作的技巧
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/299437/
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
Visual Studio - tips for managing work on many open files
提问by Cristian Diaconescu
How do you feel about VS making you hunt for a tab that you used just minutes ago when you have a bazillion open tabs? What about constantly dragging tabs around to keep the ones you use close together?
当您有无数个打开的标签时,VS 让您寻找几分钟前使用过的标签,您感觉如何?不断地拖动标签以将您使用的标签保持在一起怎么样?
Oh, so you think AARGH, too? Then read on.
哦,所以你也认为AARGH?然后继续阅读。
I work on a piece of software with dozens of projects and hundreds of files. It's really easy to get the tab bar to fill up - like when debugging, which can open a lot of files, most of which are just boilerplate, or not really interesting for the task at hand.
This makes the few files that are relevantto 'fall off' the tab bar, or a pain to find by skimming the visible tabs.
我正在开发一个包含数十个项目和数百个文件的软件。让标签栏填满真的很容易 - 就像在调试时一样,它可以打开很多文件,其中大部分只是样板文件,或者对手头的任务并不真正有趣。
这使得与“脱落”选项卡栏相关的少数文件,或者通过浏览可见选项卡很难找到。
There are some solutions, some more widely known than others. Here's my top 3:
有一些解决方案,其中一些比其他解决方案更广为人知。这是我的前 3 名:
III.This works if you can exactlyremember the file name (or at least the first letters): use the 'find box':
三、如果您能准确记住文件名(或至少是第一个字母),这将起作用:使用“查找框”:
type: Ctrl-D >of yourFileName
As you type the file name, you get autocomplete on the file names in the solution. More details here.
当您键入文件名时,您会自动完成解决方案中的文件名。更多细节在这里。
II.The most obvious one: using the 'active files' drop-down on the right of the tab bar which is alphabetically ordered.
Lesser known fact: use Ctrl-Alt-DownArrowto open that drop-down, then start typing the file name. You get the added benefit of visualizing the available choices. [info shamelessly stolen from here]
二、最明显的一个:使用按字母顺序排列的选项卡栏右侧的“活动文件”下拉菜单。
鲜为人知的事实:使用Ctrl-Alt-DownArrow打开该下拉菜单,然后开始输入文件名。您可以获得可视化可用选项的额外好处。[信息无耻地从这里窃取]
I.<drum roll/>This one is my personal favourite, and it's based on an undocumented feature of VS 2005/2008. When activated, it does one simple thing: clicking a tab moves it to the left-most side of the window. This basic action usually lets me find the tab I'm looking for in the first 3 to 5 tabs.
It goes like this:
I.<drum roll/>这是我个人的最爱,它基于 VS 2005/2008 的一个未公开的特性。激活后,它会做一件简单的事情:单击选项卡将其移动到窗口的最左侧。这个基本操作通常让我在前 3 到 5 个选项卡中找到我要查找的选项卡。它是这样的:
removed dead ImageShack link - sample animation
删除了无效的 ImageShack 链接 - 示例动画
In order to enable this functionality, you have to get your hands dirty with the Windows registry.
Compulsory edit-registry-at-your-own-risk warning:
Editing the registry may make your network card drop packets on the floor. You have been warned.
为了启用此功能,您必须熟悉 Windows 注册表。
强制编辑注册表风险自负警告:
编辑注册表可能会使您的网卡丢包。你被警告了。
Add this key to the registry for VS 2005:
将此键添加到 VS 2005 的注册表中:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio.0]
"UseMRUDocOrdering"=dword:00000001
or this for VS 2008:
或者这对于 VS 2008:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio.0]
"UseMRUDocOrdering"=dword:00000001
You don't even have to restart VS to see it work! [plagiarized from here]
Now go on, give it a try!
您甚至不必重新启动 VS 即可看到它的工作![从这里抄袭]
现在继续,试一试!
Update:This trick no longer works in VS2010 Pro :(
更新:此技巧不再适用于 VS2010 Pro :(
This wraps up my part. Now it's your turn to share how you deal with tab hunting!
我的部分到此结束。现在轮到您分享您如何处理标签搜索了!
采纳答案by Ilya Ryzhenkov
ReSharper and its Recent Files feature works a lot better for me.
ReSharper 及其最近的文件功能对我来说效果更好。
回答by o'aoughrouer
You can use Productivity Power Toolsextension for VS.
您可以使用适用于 VS 的Productivity Power Tools扩展。
Once installed go to Tools -> Options -> Productivity Power Tools -> Document Tab Well -> General -> then check "Show tabs vertically".
安装后,转到工具 -> 选项 -> 生产力电动工具 -> 文档标签井 -> 常规 -> 然后选中“垂直显示标签”。
This will give you a list of open files on your left.
这将为您提供左侧打开文件的列表。
回答by Aidan Ryan
Hold Ctrl, press Tab, and keep Ctrl held. Now you can use the arrow keys to choose any open file (right column) or tool window (left column.)
按住 Ctrl,按 Tab,然后按住 Ctrl。现在您可以使用箭头键选择任何打开的文件(右列)或工具窗口(左列)。
回答by Rob Walker
I mostly use Ctrl-TAB to cycle through the tabs I have most recently been working on. I can seem to manage a stack of 4 or 5 files without thinking in this way. If the file is out of the stack then I usually settle for reopening it again using Ctrl-O.
我主要使用 Ctrl-TAB 来循环浏览我最近使用的选项卡。我似乎可以不假思索地管理一堆 4 或 5 个文件。如果文件不在堆栈中,那么我通常会使用 Ctrl-O 重新打开它。
Or if the file I want is related to a piece of code I am looking at, so highlighting a variable, method, etc that is defined in that file and hitting F-12 works.
或者,如果我想要的文件与我正在查看的一段代码相关,那么突出显示该文件中定义的变量、方法等,然后按 F-12 即可。
回答by Sergey Vlasov
I've created Tabs Studioadd-in for Visual Studio exactly for this purpose - to comfortably work with a lot of opened files. Tabs Studio add-in offers multiple rows of tabs and tab grouping.
正是为此目的,我为 Visual Studio创建了Tabs Studio插件 - 轻松处理大量打开的文件。Tabs Studio 插件提供多行选项卡和选项卡分组。
See Tabs Studio home pagefor more information.
有关更多信息,请参阅Tabs Studio 主页。
回答by Jorge Rowies
回答by altruic
My company uses Visual Assist X. This provide numerous great features in Visual Studio, first and foremost a better "intellisense" capability. However, it also has an "Open File in Solution" dialog which allows me to type substrings of the file I'm looking for and filters the list accordingly. I highly recommend this software to any developer working with Visual Studio.
我的公司使用Visual Assist X。这在 Visual Studio 中提供了许多强大的功能,首先是更好的“智能感知”功能。但是,它还有一个“在解决方案中打开文件”对话框,它允许我键入我正在查找的文件的子字符串并相应地过滤列表。我向任何使用 Visual Studio 的开发人员强烈推荐这款软件。
回答by Michael Petrotta
Control-Tab and the ">of" trick are both useful. Neither of them quite work for me, though, especially when I've got a lot of open files or I want quicker access.
Control-Tab 和“>of”技巧都很有用。但是,它们都不适合我,尤其是当我有很多打开的文件或者我想要更快的访问时。
I like the free DPackcollection of tools. There's a lot of neat stuff in there, some of which is built in to more recent versions of VS. I haven't seent anything like the file browser, though. It sits as a tool window (or dialog, if you prefer), and gives you an incrementally-filtered list of files in your solution. You can limit the list to open files if you use it as a modal dialog, apparently, though I haven't tried that.
我喜欢免费的DPack工具集。那里有很多整洁的东西,其中一些内置于较新版本的 VS 中。不过,我还没有看到类似文件浏览器的东西。它作为一个工具窗口(或对话框,如果您愿意),并在您的解决方案中为您提供一个增量过滤的文件列表。如果您将列表用作模式对话框,您可以将列表限制为打开文件,显然,尽管我还没有尝试过。

(source: usysware.com)

(来源:ussysware.com)

