Moving (efficiently) vertically in Vim

H, M and L will move your cursor to the top, middle and bottom of the screen, respectively. Subsequently, you can hit zz to center the screen on the line your cursor is on.


  • you can use the up/down arrow to move one line
  • you can type a number and then use the up/down arrow to move up/down that many lines
  • small g jumps to the first line of the document
  • capital G jumps to the last line of the document
  • etc.

there are a gazillion of other different ways, vim is very flexible in this respect. I would recommend to get a vim cheat sheet first for basic commands, and then as you have time, go through the vim documentation on this subject.

Link to one cheat sheet: Cheat sheet

Also:

  • / + string + (Enter) searches for the next occurrence of string from the cursor forward to the end of the document
  • ? - does the same but from the cursor backwards towards the beginning of the document

  • { } will get you to the beginning / end of the next paragraph
  • ( ) the same for sentences
  • ^ $ the first, last character of line

Quick reference / cheat sheet here