Just another tech blog.

A blog abt GNU/Linux, programming, hacking, and my life.

Vim Timeline

Posted by ajay on October 13, 2009

I found an interesting feature of vim today. If you edit lots of files and dont close your vim session for long time, then its a very powerful feature. It essentially allows you to jump back in time and change a file to what it looked like at a particular time.

For example, you made lots of changes, now dont remember them and want to switch back to the version of the file 10 minutes ago, you can just do

:earlier 10m

Similarly, if you want to jump 5 seconds ahead of time, you can do

:later 5s

Also, doing

:earlier 10

means doing 10 undo’s in one shot :).

Happy Vimming :).


13 Responses to “Vim Timeline”

  1. They should put a “like this post” option on blogs too..

  2. Sambhav said

    wow!! very useful!!

  3. hellboy said

    “LIKE” …
    @turbo .. i expressed the same view sometime back in himank’s post 😛 ..

  4. Meghna said

    Awesome…very useful 🙂
    Thanks for sharing !!!

  5. mythalez said

    nice … this is something i always needed but never realised that i did 😛

  6. maruti borker said

    nice nice tx bro !

  7. Wow, this is so kewl !! Like time traveling…

  8. Kiran Danduprolu said

    sounds interesting …. i dont use vim much but when i get to use it I will remember this

  9. Sankalp Khare said

    $ vim timeline.txt

    “earlier and later are commands… very useful :)”

    (wait 5 mins)

    :earlier 10m



    great tips sir…

  10. aa said

    There’s a quicker way to undo the last operations in command mode:

    Eg. to undo the last 10 operations, you would do:

  11. Missy said

    It’s great to read something that’s both enjoyable and provides prdgamtisac solutions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: