Reputation: 1269
I want to be able to move the cursor (not move the line of code) in the text editor up a block or down a block by pressing <ctrl>+<uparrow>
or <ctrl>+<downarrow>
. In jEdit, Leafpad, etc, this just works out of the box. I do not want to move an entire page at a time, just simply go to the start or end of the text block that I happen to be on.
Specifically, I want this, but for VS 2012 (which no longer has macros): keyboard shortcut to move from one code block to another in VS2008
I've seen these posts, and they are not what I'm after; I do not want to move code, I want to move the cursor to the top or bottom of the block I happen to be on. Visual Studio: hotkeys to move line up/down and move through recent changes Visual Studio - Scroll AND move cursor
I have checked in ReSharper as well, and cannot seem to find an answer there.
Does anyone know of an add-in that provides this functionality?
Upvotes: 6
Views: 5148
Reputation: 1269
I removed everything that was bound to these shortcuts, then bound it to Edit.PreviousMethod and Edit.NextMethod. This put the focus on the method box in the editor, but then you have to press enter to get it to navigate to that method.
The best I could find was using ReSharper, which I was trying to avoid. However, I'm a minimalist and ReSharper got in my way, I was leaving it toggled off almost all the time, so I uninstalled it.
I believe it was ReSharper.MoveToNextMethod or .NavigateToNextMethod, but I have uninstalled it so I'm going on memory. Using it, it would jump to the beginning of the previous or next method, which was not quite what I was looking for, but better than nothing.
Edit: I gave up. I moved to .Net Core for c# code and do all my editing outside of Code, using text editors that employ common keyboard shortcuts like Geany, jEdit, etc.
Upvotes: 2
Reputation: 26766
Bind them to Edit.PreviousMethod
and Edit.NextMethod
in the Options->Environment->Keyboard?
Upvotes: 3