jxramos
jxramos

Reputation: 8276

How to scroll without moving my cursor in Visual Studio Code from the Keyboard

I used to be able to scroll in Visual Studio 2015 using some keyboard shortcuts in Windows doing something like ctrlshiftdown. It would effectively behave like a line by line viewport bump that did not modify where my cursor was inserted at. This is much like how scrolling with a mouse wheel does not move the cursor except its achieved from the keyboard.

I can't figure out how to do this on Visual Studio Code on a Mac.

Upvotes: 53

Views: 30903

Answers (9)

Devin
Devin

Reputation: 1992

On my Mac Ctrl+fn+Up Arrow / Down Arrow works similar to mouse scroll. This doesn't affect the cursor position.

2024 update: ctrl+page up/down, on MacOS (thanks @zzzgoo)

Upvotes: 65

RukshanJS
RukshanJS

Reputation: 966

Course scroll

  • Scroll in large line heights (don't know exactly how much)

fn + cmd + Up/Down Arrow

Fine scroll

  • Scroll in single line heights. Most answers have pointed this out.

fn + ctrl + Up/Down Arrow

Tested in Mac with VS Code 1.85.1 (Universal)

Upvotes: 1

On Windows it is ctrl+Down Arrow. On Mac I believe it will be cmd key instead of ctrl

Upvotes: 16

Ricardo
Ricardo

Reputation: 4328

Learning how to fish 🎣

If you're not using default shortcuts - such as when you came from a different editor and "imported the keybindings" (see Keymap extensions), you may want to:

  1. Go to the Keyboard Shortcuts editor at File > Preferences > Keyboard Shortcuts. (Code > Preferences > Keyboard Shortcuts on macOS)
  2. Search for scrollLine
  3. Check or change your current keybindings for scrollLineUp and scrollLineDown

enter image description here

Upvotes: 15

Henry J. Perez
Henry J. Perez

Reputation: 31

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.

Upvotes: 0

Mohammad amin
Mohammad amin

Reputation: 11

you can push the shift and mouse roller

Upvotes: -2

GittinJiggyWithIt
GittinJiggyWithIt

Reputation: 441

fn + ctrl + up/down arrow did the trick for me on Mac for moving just one line at a time.

Upvotes: 30

Gilson Cavalcanti
Gilson Cavalcanti

Reputation: 1513

For me on mac what worked out was CMD + fn + Up/Down Arrow

Upvotes: 34

Filipe
Filipe

Reputation: 884

You can move one window height with fn+Up/Down Arrow

Upvotes: 4

Related Questions