10

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.

Kirill Yunussov
  • 1,955
  • 1
  • 21
  • 24

1 Answers1

17

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.

Mark
  • 143,421
  • 24
  • 428
  • 436