Vim Tip of the Week : August 17th, 2007 – Time based Undo (or Redo)

By | 2007/08/17

Well these Vim tips have really been one of the more popular topics to come through this blog in a while.  I’d like to keep with tradition and keep these going each Friday.  This weeks tip is reverting or redoing changes based on time, vs simply the undo command (‘u’) and redo command (‘ctrl-r’).

From the vim :help section:

:earlier {count}    Go to older text state {count} times.

:earlier {N}s    Go to older text state {N} seconds before.

:earlier {N}m    Go to older text state {N} minutes before.

:earlier {N}h    Go to older text state {N} hours before.

Also supported is the :later command following the same syntax pattern. Easily revert to changes at previous times with the :earlier, or re-do changes forward with :later.  Of course :later won’t read your mind and create your document for you, but once you’ve gone back in time you can go back to the future.

For more info on this tip type “:help earlier” within vim.

One thought on “Vim Tip of the Week : August 17th, 2007 – Time based Undo (or Redo)

  1. Pingback: University Update - Kate Beckinsale - Vim Tip of the Week : August 17th, 2007 - Time based Undo (or Redo)

Leave a Reply

Your email address will not be published. Required fields are marked *