visual-studio 用于模拟 Eclipse 的“开放类型”或“开放资源”键盘访问的 Visual Studio 插件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3067/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 16:20:33  来源:igfitidea点击:

Plugin for Visual Studio to Mimic Eclipse's "Open Type" or "Open Resource" Keyboard Access

visual-studioplugins

提问by The How-To Geek

If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list.

如果您曾经使用过 Eclipse,您可能已经注意到了很棒的键盘快捷键,它可以让您点击快捷键组合,然后只需输入函数、类、文件名等的前几个字符。它甚至足够聪明,可以打开列表中的第一个文件。

alt text

替代文字

I'm looking for a similar functionality for Visual Studio 2008. I know there's a findfiles plugin on codeproject, but that one is buggy and a little weird, and doesn't give me access to functions or classes.

我正在为 Visual Studio 2008 寻找类似的功能。我知道 codeproject 上有一个 findfiles 插件,但那个插件有问题而且有点奇怪,并且不能让我访问函数或类。

回答by Cohen

Vs11 (maybe 2010 had it too) has the Navigate To... functionality which (on my machine) has the Ctrl+,shortcut.

Vs11(也许 2010 年也有)具有导航到...功能,(在我的机器上)具有Ctrl+,快捷方式。

By the way it understands capitals as camelcase-shortucts (eclipse does so too). For instance type HH to get HtmlHelper.

顺便说一句,它将大写字母理解为驼峰式缩写(eclipse 也是如此)。例如输入 HH 以获取 HtmlHelper。

回答by Andy

This isn't exactly the same as Eclipse from your description, but Visual Studio has some similar features out of the box (I've never used Visual Assist X, but it does sound interesting).

这与您描述的 Eclipse 不完全相同,但 Visual Studio 具有一些开箱即用的类似功能(我从未使用过 Visual Assist X,但听起来确实很有趣)。

The Find ComboBox in the toolbar ends up being a sort of "Visual Studio command line". You can press Ctrl+/(by default) to set focus there, and Visual Studio will insert an ">" at the beginning of the text (indicating that you want to enter a command instead of search). It even auto-completes as you type, helping you to find commands.

工具栏中的 Find ComboBox 最终成为一种“Visual Studio 命令行”。您可以按Ctrl+ /(默认情况下)在那里设置焦点,Visual Studio 将在文本的开头插入一个“>”(表示您要输入命令而不是搜索)。它甚至会在您键入时自动完成,帮助您查找命令。

Anyway, to open a file from there, type "open <filename>". It will display any matching files in the drop down as you type (it pulls the list of files from the currently open solution).

无论如何,要从那里打开文件,请键入“open <filename>”。当您键入时,它将在下拉列表中显示任何匹配的文件(它从当前打开的解决方案中提取文件列表)。

To quickly navigate to a function, in the code editor press Ctrl+Ito start an incremental search. Then just start typing until you find what you are looking for. Press Escapeto cancel the search, or F3to search again using the same query. As you are typing in the search query, the status bar in the lower left corner will contain what Visual Studio is searching for. Granted, this won't search across multiple files (I've never used Eclipse much, but that sounds like what it does from your description), but hopefully it will help you at least a little bit.

要快速导航到某个函数,请在代码编辑器中按Ctrl+I开始增量搜索。然后就开始打字,直到找到您要找的东西。按Escape取消搜索,或F3使用相同的查询再次搜索。在您输入搜索查询时,左下角的状态栏将包含 Visual Studio 正在搜索的内容。当然,这不会跨多个文件进行搜索(我从未经常使用 Eclipse,但这听起来像您的描述中所做的那样),但希望它至少能对您有所帮助。

回答by Martin Kutny

If anyone stumbles upon this thread:

如果有人偶然发现此线程:

There's a free plugin (created by me) for Visual Studio 2008 that mimics the Eclipse Ctrl+Shift+ROpen Resource dialog (note, not the Open Type dialog). It works with any language and/or project type.

Visual Studio 2008 有一个免费插件(由我创建),它模拟 Eclipse Ctrl+ Shift+R打开资源对话框(注意,不是打开类型对话框)。它适用于任何语言和/或项目类型。

You can find it at Visual Studio Gallery.

您可以在Visual Studio Gallery 中找到它。

回答by graham.reeds

Some of the neat features are available in Visual Assist X, though not all of them. I've asked on their forums, but they haven't appeared as yet. VAX gets updated regularly on a rough 4 week period for bug fixes and a new feature every couple of months.

Visual Assist X 中提供了一些简洁的功能,尽管不是全部。我在他们的论坛上问过,但他们还没有出现。VAX 会在大约 4 周的时间内定期更新,以修复错误并每几个月更新一次新功能。

回答by Jon Limjap

Resharperdoes this with the Ctrl-Nkeyword. Unfortunately it doesn't come for free.

Resharper使用Ctrl-N关键字执行此操作。不幸的是,它不是免费的。

Visual Studio doesn't have anything like this feature beyond Find.

除了 Find 之外,Visual Studio 没有任何类似的功能。

回答by huseyint

If you are looking for an add-in like this to quickly navigate to source files in your project:

如果您正在寻找这样的加载项来快速导航到项目中的源文件:

SonicFileFinder 1.8.5

SonicFileFinder 1.8.5

try the Visual Studio 2005/2008 add-in SonicFileFinder.

试试 Visual Studio 2005/2008 插件SonicFileFinder

回答by Andre Albuquerque

Found this thread while searching for Eclipse's Ctrl+Shift+R, and after seeing the Visual Studio Gallery, found the DPack Tools(they are free, and no, I'm not endorsed in any way by them).

在搜索 Eclipse 的 Ctrl+Shift+R 时找到了这个线程,在看到 Visual Studio Gallery 后,找到了DPack 工具(它们是免费的,不,我没有以任何方式得到它们的认可)。

But it's exactly what I was searching: - Alt+U -> File Browser (a la Eclipse Ctrl+Shift+R) - Alt+M -> Code Browser (Method list in the actual class)

但这正是我要搜索的内容:- Alt+U -> 文件浏览器(类似于 Eclipse Ctrl+Shift+R)- Alt+M -> 代码浏览器(实际类中的方法列表)

It has more features, but I'm happy with these ones.

它具有更多功能,但我对这些功能很满意。

回答by Andre Albuquerque

I have been using biterScripting along with Visual Studio to do more flexible searching and manipulation.

我一直在使用 biterScripting 和 Visual Studio 来进行更灵活的搜索和操作。

  1. It can search the entire workspace.

  2. It can search within any project - EVEN IF THAT PROJECT IS NOT LOADED OR EVEN PART OF A WORKSPACE.

  3. It can find things using regular expressions.

  4. AND, ABOVE ALL, it can make bulk changes. For example, want to change the name of a class from CCustomer to CUser, I can do it in just a few command lines - Actually, I have written scripts for things like this I do often. I DON'T HAVE TO CLICK ON EACH INSTANCE AND MANUALLY DO THE CHANGE.

  5. And, it is inexpensive ($0). I downloaded it from http://www.biterscripting.com.

  1. 它可以搜索整个工作区。

  2. 它可以在任何项目中搜索 - 即使该项目未加载或什至是工作区的一部分。

  3. 它可以使用正则表达式查找事物。

  4. 而且,最重要的是,它可以进行批量更改。例如,想要将一个类的名称从 CCustomer 更改为 CUser,我只需几个命令行即可完成 - 实际上,我已经为我经常做的此类事情编写了脚本。我不必单击每个实例并手动进行更改。

  5. 而且,它很便宜(0 美元)。我从http://www.biterscripting.com下载了它。

回答by seoservice.ch

I'm also comming from the Java Development side and was looking for the CTRL+T feature in the Visual Studio. The other answers refer to open file, but since in C# the class name and file name can be different this is not what i was looking for.

我也来自 Java 开发方面,正在寻找 Visual Studio 中的 CTRL+T 功能。其他答案是指打开的文件,但由于在 C# 中,类名和文件名可能不同,这不是我想要的。

With the Class Viewor the Object Browseryou can search for Objects and Classes

使用类视图对象浏览器,您可以搜索对象和类

[View]->[Class View] or [View]->[Object]

[视图]->[类视图]或[视图]->[对象]