6

I was working on data.md a day ago and worked on numerous other files from then till now. I'd like to go back to my last position in data.md without touching other files.

Using ctrl-o would make me go through other files I've worked on in between. I'd like a ctrl-o/ctrl-i equivalent for jumping around only in the current file.

What's a good way to jump through the jump list but only within the current file?

1 Answer 1

2

'" Will jump to the last position the cursor was when you last left the buffer. :he '" for more info.

You can set this up automatically, with the snippet found at :he last-position-jump

Just to clarify, CTRL-O moves you through the jumplist, whereas '" is moving you to an automatically created mark.

Another nice tip is gi which will put you into insert mode at the position you last inserted text

2
  • 1
    g; and g, are a recent addition to my repertoire for moving through the change list
    – D. Ben Knoble
    Oct 2, 2020 at 12:39
  • g; and g, are great.
    – Gambo
    Oct 2, 2020 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.