vi screen scrolling - dylanwan/dylanwan.github.io GitHub Wiki

These are cursor movement keys:

  • H - goes to the top of the screen
  • M - move cursor to the middle of the screen
  • L - move cursor to the bottom of the screen

There are commands that scroll the text like the scroll bar on the right in window. They do not change the cursor position in the text:

  • ctrl-E scroll down one line; This command is useful for reading
  • ctrl-Y scroll up one line
  • zz center the screen. The cursor and the text will be moved to the center of the screen
  • zt move the cursor to the top of the screen alone with the text
  • zb move the cursor to the bottom of the screen alone with the text

These commands change the cursor to the beginning of the lines. I feel that I may never need to use them as I can use zz, zt, or zb

  • z<CR> move the cursor to the top and move the cursor to the beginning of the line it does almost the same as zt
  • z. move the text cursor is on to the center of the page and move the cursor to the beginning of the lines it does almost the same as zz

These are the real scroll up and scroll down, regardless where your cursor position is. Since the current position may be out of the page. The cursor will move to a different position.

  • ctrl-f page forward - the bottom 2 lines you can see now become the top in the new page. The cursor will be on the top of the page
  • ctrl-b page backward - the top 2 lines will become the bottom two lines in the new page. The cursor will be at the bottom of the page
  • z+ to the next page - there is no overlapping between the new page and the current page
  • z^ to the previous page - similar to to ctrl-b but no overlapping lines
⚠️ **GitHub.com Fallback** ⚠️