Reputation: 91598
I just installed Visual Studio 2012 and am having a hard time navigating within a file. What I'd like to be able to do is type in one or more characters of a class, method, field or property within a file and jump right to that line. For example, if I had the code:
public class Foo
{
public void Bar()
{
}
}
I'd like to be be able to hit a keyboard shortcut, type "Ba" and jump right to the Bar
method of the Foo
class.
In VS2008 and VS2010, I used USysWare's DPack to do this using the Alt + G keyboard shortcut. However, there does not appear to be a version of this plugin for VS2012, at least not yet.
I did find the Ctrl + ; shortcut key to search the solution, which seems to work fairly well for jumping to a specific file (similar to DPack's Alt + U shortcut), however I'm looking for something that will search code within the currently opened file.
BTW, I'm currently using VS2012 Express Edition, but will be upgrading to VS2012 Pro when I have the time to download it and set it up. I believe there's some minor differences between these versions, so I'm interested in answers that apply to either or both.
Upvotes: 9
Views: 12927
Reputation: 21
I'm using VS Community 2019. I found this combination key:
Upvotes: 1
Reputation: 6627
In VS 2017 (not sure, may be also work for some previous versions):
Upvotes: 6
Reputation: 6487
With Resharper you can use Ctrl+F12 to navigate to a member of the current class, method or field.
Upvotes: 0
Reputation: 91598
So here is a summary of what I've found out after some research.
DPack for Visual Studio 2012: Currently, it's in beta but works perfectly fine. Since this is a plugin, it won't run on the Express Edition of Visual Studio.
Ctrl+F: The standard Ctrl+F dialog has been completely re-invented in Visual Studio 2012 and is more of an inline search, jumping around in your document as you type. It's fairly usable for finding symbols, but would also find any matching text in the document, including references, string constants, comments, whatever. For this reason, it's probably not the best way to quickly jump right to a symbol.
Ctrl+Comma: This is also a new VS2012 feature, however it's not available in Visual Studio Express Edition. This allows you to quickly find a symbol within your solution. It works fairly well, though for larger projects it might be information overload.
Ctrl+Semicolon: The Solution Explorer now allows you to filter by filename using the Ctrl+; shortcut key. This makes finding files quick and easy, however will not search symbols within the current file. This is more analogous to DPack's Ctrl+U feature.
Class View Search: Within Class View mode (Ctrl+Shift+C), you can also search for class names or symbols within your entire solution. However, there does not appear to be a keyboard shortcut to use this search, nor can you just search the currently opened file. Also, you have to enter your query and press enter to display the results, rather than just filtering as you type.
Class/Method Dropdowns: Like previous versions of Visual Studio, code files have dropdowns just below the file tabs that display classes and methods within the current file. This is fairly unusable for quickly jumping to any method in the document, as you would first need to select which class the symbol is defined in, and then select the symbol itself. Also, there's no keyboard shortcut that I could find, nor is there an easy way to filter the items in the list by typing part of the symbol name.
Upvotes: 11
Reputation: 18348
You can use Ctrl+,
- just type whatever you want in the box and it will find you the corresponding symbols.
Upvotes: 8
Reputation: 1225
In the top of the solution explorer, you can search there.
Also, you can drill down into the code from the solution explorer. This will bring you to each of the properties and methods.
Upvotes: 0
Reputation: 318
If I understood correctly, you can do that via the dropdown menu on the right, just above the coding window.
I don't know any other way, but that doesn't mean there isn't. Hope this helps.
Upvotes: 0