After you scroll in the Editor using the keyboard (Ctrl+UpArrow/DownArrow), the cursor stays behind where it was, maybe 5-10 screens back.
Is there a command to move the cursor into the center of the current screen that I am viewing, so that I can edit whatever I am looking at?
I could do "Go To Line" (Ctrl+G, then type the line number), but I am looking for a single-press keyboard shortcut.
Moving the Cursor on a Windows PC Move Cursor To Keyboard Shortcut the top of the page CTRL + HOME the bottom of the page CTRL + END one word to the right CTRL + RIGHT ARROW one word to the left CTRL + LEFT ARROW 2 more rows ...
To set cursors above or below the current position use: Keyboard Shortcut: Ctrl+Alt+Up or Ctrl+Alt+Down You can add additional cursors to all occurrences of the current selection with Ctrl+Shift+L.
Use ctrl + Up/Down Arrow to move. I have linux and the vim extention for vscode. This command scrolls the view but not the cursor. So, keep that in mind. does the mouse roller even move the cursor?
I used to be able to scroll in Visual Studio 2015 using some keyboard shortcuts in Windows doing something like ctrl shift down. It would effectively behave like a line by line viewport bump that did not modify where my cursor was inserted at.
Try this in your keybindings.json:
{
"key": "alt+m", // or whatever binding you choose
"command": "cursorMove",
"args": {
"to": "viewPortCenter"
}
}
See also: to automatically move cursor as you scroll if that is desirable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With