Lernkurve
Lernkurve

Reputation: 21532

What is Eclipse's Ctrl+O keyboard shortcut equivalent in Visual Studio 2012?

Question

Is there a keyboard shortcut in Visual Studio to show all methods of the class and to quickly jump to one by typing the first few letters of the method name and pressing Enter?

This is what Ctrl+O looks like in Eclipse.

enter image description here

Image source: http://rayfd.files.wordpress.com/2007/05/ctrl_o_2.jpg?w=700

Side notes

Without using ReSharper as described here Visual Studio: Missing Ctrl+O+O, Ctrl+T Eclipse analog

And something that is better than Ctrl+F2 followed by Tab as described in this Stackoverflow answer.

Upvotes: 17

Views: 5867

Answers (3)

donah
donah

Reputation: 113

You may use Ctrl + Shift + o (go to symbol...) as alternative.

Upvotes: 6

Abhishek Shrivastav
Abhishek Shrivastav

Reputation: 1

Press Ctrl + P and then type @

You'll get all the method names opened in that file, as a suggestion, and can jump from there itself.

Edit: this only works for VSCode.

Upvotes: -2

Richard Banks
Richard Banks

Reputation: 12546

(I'm going to assume you're using the 'General Development' settings for keyboard shortcuts)

Without using any addins to achieve this and without using the method explained in the other SO answer about the only approaches I can think of are the following:

Use Ctrl + , to bring up the Navigate To... window, however it searches across everything not just your current file.

Or.... you could do a little keyboard gymnastics, though it's nowhere near as simple as the Ctrl+O option from Eclipse or the other approaches that have been suggested.

If you scope Solution Explorer to the current file then you can just use the Ctrl + ; to search the methods and properties in the file.

To set the scope in Solution Explorer you can use Ctrl + [,Ctrl + S to sync SE with your current file. You could then map something like Ctrl + K,S to the ProjectAndSolutionContextMenus.Project.ScopeToThis command in Visual Studio's keyboard options. The only hassle with this approach is that you'll need to click the back button to go back to the full solution explorer view.

Alternatively if you use Ctrl + [,Ctrl + O you can toggle the Open Files filter in Solution Explorer's. Assuming you don't have too many open files then this might be a pretty simple way to do it.

Sorry to say, but your best option would be to use an add-in that provides a "go to member" function, such as AsEclipse (I haven't tried it) or one of the other commercial productivity tools. You might also drop a suggestion on the UserVoice site for it.

Upvotes: 4

Related Questions