Keyboard shortcut for moving from one code block to another in VS2008

Is there a shortcut in Visual Studio 2008 to go from one block of code to another block of code directly? How to say from one function: the beginning of the next function.
Currently, all I can do is press the arrow keys.

Edit: I know Ctrl +] to jump between the corresponding figures, but this does not release me from a few taps up / down. Also, "Edit.NextMethod" does not work, since it is always disabled if you do not edit the VB code (it does not work either).

+4
source share
4 answers

Macros are the solution: The VS2008 comes with sample macros that contain:
Sample.VSEditor.BeginningOfFunction - to go to the beginning of the function. This can be changed to make it jump to the end of the function instead by changing: CodeElement. GetBeginningPoint on GetEndPoint . Then another custom macro: NextMethod () first goes to the end of the current function, then finds the next function, and finally goes to the beginning of the next function.

Get the macro: http://social.msdn.microsoft.com/Forums/en/csharpide/thread/8c5a2fd2-df25-4196-b211-5da3086f4f3d

+4
source

If you place the cursor on the left of the opening { , then Ctrl + } move you to the end of this method / block / statement

+9
source

In VB.NET (VS 2010), I wanted to restore the old VB6 editor function to go to the next and previous methods in the class by pressing Ctrl - DownArrow and Ctrl - UpArrow .

It was easy to take the following steps:

  • Go to "Tools / Options", then "Environment / Keyboard".
  • In the "Show commands containing:" field, enter "Edit.NextMethod". This command should appear in the list. Click on it to select it.
  • Press "Press keyboard shortcuts:" to get focus. Press Ctrl + Up Arrow . Verify that this key combination is now displayed in the text box.
  • Look in the text box below "Label currently used:". Make sure that the shortcut currently used by this key combination is not the one you want! [unlikely, otherwise you will not try to reassign the keys]
  • Click the Assign button
  • Then click OK

You can do the same with Edit.NextMethod and Ctrl + Down Arrow .

+1
source

Ctrl + Up and Ctrl + Down will go to the previous / next function.

0
source

Source: https://habr.com/ru/post/980612/


All Articles