Geek
Geek

Reputation: 27219

How to use the :undolist feature in vim?

After making a couple of changes in an xml file opened in Vim I pressed :undolist and got the following output. Is there any way I can see the actual changes? Also what is the difference between number and changes columns? I see the numbers are always the same.

 number changes  time
         2       2  10 seconds ago

Upvotes: 4

Views: 2189

Answers (1)

Kent
Kent

Reputation: 195269

if you :h undolist, difference between number and changes is explained. in short, number is a sequence number, changes are how many changes were made on that leaf.

If you want to go back to a earlier state, you could check :h earlier

I recommend a very nice undo plugin: https://github.com/sjl/gundo.vim with this you could view the states in history, without really applying them, until you find the right state.

Upvotes: 5

Related Questions