Imaging I'm editing some code, and I found a few words that I would like to paste at the current cursor position elsewhere in the file. I will go to them, yank them, but then how do I return back to the original location to paste them?

3 Answers 3


You can use explicit marks with m normal command:

  1. ma -- mark position into register a
  2. goto anywhere
  3. return to the marked position with `a
  • :h mark-motions
  • :h registers
  • Thank you, this is what I was after, I will dispense the ticks in a couple of days May 27, 2022 at 23:16

If you jump to the interesting part with a motion, you could use :h <c-o> to jump back where you were.

Another possible approach is to copy the line with :h :copy / :t, like so:


This will search for the next line matching 'pattern' and copy it (t) under the current line (.).


In addition to <C-o>, there is the single-quote and backtick mark: '' and ` go the line and line + column from before the last jump I believe.

Your Answer

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

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