vim – Jumping around in code

Sometimes you want to jump back to an area of code, so it would be nice to have a bookmark or something similar handy. Well, vim has this feature too.

  • m<someletter> – This will “mark” this particular spot for you to return to later.
  • <someletter> - The backtick and the letter you used to mark that spot will jump to that location again.
  • . – Backtick and period will jump back to the last edited spot. Useful if you edit something, go to a different area to look at something and need to jump back quickly.

Don’t forget to use “zz” to make your life easier as you jump around.

Leave a Reply

You must be logged in to post a comment.