Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the :undolist feature in vim?

Tags:

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
like image 592
Geek Avatar asked Oct 22 '25 05:10

Geek


1 Answers

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.

like image 93
Kent Avatar answered Oct 24 '25 05:10

Kent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!