Is there a keyboard shortcut to move the cursor between methods in Visual Studio 2010?

Visual Studio-2010PluginsKeyboard ShortcutsVisual Studio-Extensions

Visual Studio-2010 Problem Overview


Is there any keyboard shortcut to move the cursor between methods in Visual Studio? Is there any plugins that can do the same job?

All the time when I program, I want to go at the end of the current method and if I could have a shortcut that can move the cursor at the beginning of the next method and then just have to type a couple of up arrow to be where I want would be fantastic.

Thank you.

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

> Note: For VS <2015, the following works only for the VB.NET code editor. In VS 2015+, apparently the C# code editor is also supported.

While there are no default keyboard bindings to jump between methods, you can set them up yourself:

Go to ToolsCustomize…, then Keyboard…, and do the following:

  1. Search for the commands by typing Method in the input line at the top.

  2. Locate the two commands Edit.NextMethod and Edit.PreviousMethod.

  3. For each of these, select the command first, then move the input focus to the input field Press shortcut keys, enter an unassigned key combination, and press the Assign button.

Options dialog where keyboard bindings can be set up and modified

(The screenshot above shows that I have previously assigned one of these commands to Ctrl+Shift+<.)

Solution 2 - Visual Studio-2010

Hi another (cheaper) alternative might be the CTRL+M+M to collapse/expand the current method to it's definition, allowing you to quickly navigate to the next. Also CTRL+M+O to collapse all members is useful, with CTRL+M+L to expand all again.

Solution 3 - Visual Studio-2010

Visual Studio doesn't have such a function, but JetBrains' ReSharper does. At least is the only one that I know of to offer this functionality.

For ReSharper the shortcuts are Alt-Up and Alt-Down, for previous/next member.

Solution 4 - Visual Studio-2010

Try CTRL + ALT + UP. This first takes you to the scope selector where you can select a class if applicable, then press TAB which takes you to the method selector where you can select a method from the selected scope.

Note I use In Visual Studio 2012, don't know if works in other versions.

Solution 5 - Visual Studio-2010

Jason Malinowski is right on his comment. It even says the shortcut keys are Ctrl+Down Arrow and Ctrl+Up Arrow. I used to use this all the time in VB6, but when I tried it lately using recent versions of visual studio, it didn't work; it would just scroll the edit window up or down one line.

When I went into Tools -> Options, select "Environment" on the left, and then the subcategory of "Keyboard", then type "Edit.ScrollLineDown" it said Ctrl+Down Arrow. When I removed this shortcut (and the one for ScrollLineUp), the next/previous method shortcuts then worked! I'm personally very happy about this.

Obviously, if you can find the right command, you can customize your keyboard shortcuts any way you please here.

Solution 6 - Visual Studio-2010

I know this is old, but looks like it was added since.

Try Alt+[ or Alt+]

Solution 7 - Visual Studio-2010

In Visual Studio 2013 with the commercial Visual Assist expansion you can use ALT+M to open a list with all methods in the current file. Select one, hit ENTER and the cursor will jump to it.

Solution 8 - Visual Studio-2010

do not forget about the excellent, free DPack extension, which will add Alt+m shortcut which will open a list of all methods in the current class. You can type a search string to filter, and what is also great is if you tab down and enter on a method, and then later do Alt+m again, if you tab into the window you will be on the last method you selected. DPack also has many more features, like bookmarks, but I do find that you have to setup the hotkeys, or more exactly, re-assign hotkeys from other functions to DPack: https://marketplace.visualstudio.com/items?itemName=SergeyM.DPack-16348

Solution 9 - Visual Studio-2010

Its Ctrl + } - by placing the cursot to end of line - using studio 2015

Same will also bring the cursor back to bottom.

so place the cursor at end of function and press Ctrl + }

Solution 10 - Visual Studio-2010

In Visual Studio 2015:

Alt + Up or Alt + Down

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSamuelView Question on Stackoverflow
Solution 1 - Visual Studio-2010stakx - no longer contributingView Answer on Stackoverflow
Solution 2 - Visual Studio-2010user369142View Answer on Stackoverflow
Solution 3 - Visual Studio-2010Marcel N.View Answer on Stackoverflow
Solution 4 - Visual Studio-2010BeginnerView Answer on Stackoverflow
Solution 5 - Visual Studio-2010SteveView Answer on Stackoverflow
Solution 6 - Visual Studio-2010AlbertView Answer on Stackoverflow
Solution 7 - Visual Studio-2010VisorZView Answer on Stackoverflow
Solution 8 - Visual Studio-2010KerneelsView Answer on Stackoverflow
Solution 9 - Visual Studio-2010Anurag.DesaiView Answer on Stackoverflow
Solution 10 - Visual Studio-2010Mohsen AfshinView Answer on Stackoverflow