2

I read the following on vim tips

'`' ('' is a mark specifier): move to the position of the given mark) - mark '.' is the last edited position

My question is suppose I have two line

Line 1 
Line 2 
Line 3 
Line 4

Suppose I edited line1 (insert mode) then escaped into normal mode and went to line 4 (edited line 4). What would be the best approach to go back to line 1 (Which was my inital edit).

I was thinking that since `. would take us to the last edited position maybe 2``. would take us to the second last edited position. Sorry i added two back ticks since one back tick triggers formatting. Any suggestions on how the experts handle this. I know I could use marks but i dont feel like adding a mark to every line I edit unless i have no other option.

5

What you want is the "changelist": :help changelist.

Use 3g; to jump to the third previous change in the "changelist" and 2g, to jump back 2 steps in the list.

  • 1
    No :changelist found when I checked. But found :changes, changelist – vusan May 4 '16 at 6:26
  • @vusan, oops. I initially wrote :changes but thought that :help changelist would be more appropriate and… in the end I forgot the colon. Thank you. – romainl May 4 '16 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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