1

I am aware of the undofiles in Vim but they are binary and I don't know how to read them. I tries strings but it didn't help for my purpose.

I am also aware of the :changes command but that only gives me the list of changes with their location.

What I need is the timestamps of these changes.

I believe it should be possible to have that since there is the :earlier command but I couldn't figure how.

What I want is to figure out when the file was last changed and hopefully also the timestamps of all the previous changes. stat did not help.

1 Answer 1

1

Maybe the undotree plugin can help you. It provides a list of the changes together with the time difference. The S mark identify the version that have been saved in disk.

enter image description here

If you prefer to get the absolute date time of the change you can set:

let g:undotree_RelativeTimestamp = 0

enter image description here

It relies on the undotree() function that return a dictionary of all the undo states of the current buffer (stored partly in memory restored at buffer load time from the corresponding undo file). More information with :help undotree() for the description of the content of the return dictionary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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