Vim: Scroll up/down, keeping your cursor in its row

Updated . Posted . Visible to the public.

If you are in the middle of a file and want to scroll, but don't want to move your cursor all the way to the top row, use this:

One line

  • Ctrl+Y → Move viewport down
  • Ctrl+E → Move viewport up (Extra lines)

Half a screen

  • Ctrl+U → Move viewport Up
  • Ctrl+D → Move viewport Down

Those are the default key bindings, they may be different for other layouts/behaviors (like mswin).

Read everything about scrolling in vim in the linked vimdoc Show archive.org snapshot .

Arne Hartherz
Last edit
Keywords
current, line
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2011-07-26 13:35)