0

I have persistent undo enabled for vim, is there someway I can inspect a directory's entire undo history? For example something like a list of files sorted by last change recorded.

My intention is to be able to remember what files I last worked on in a project (under a directory). I'm already using version control via git however in this case it's to determine state of files that have not yet been committed (a state of work in progress).

I see there is a undotree() which states:

undotree() undotree() Return the current state of the undo tree in a dictionary with the following items:

I've tried calling :undotree or eval undotree "/home/chris" but it does not seem to succeed with anything relevant.

2
  • My intention is to be able to remember what files I last worked on in a project then instead of tweaking the undo function maybe it would be easier to use a session? :h Session When you leave vim you use mksession to store your currently open files and layouts and when you get back to your directory you source the session file. There are even plugins which ease the use of sessions. Would that fit your need?
    – statox
    Mar 9, 2022 at 11:02
  • 1
    "files sorted by last change" on a unix like, I think that's ls -rt. Otherwise, sessions paired with github.com/tpope/vim-obsession has been a good workflow for me.
    – D. Ben Knoble
    Mar 9, 2022 at 14:00

0

Your Answer

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

Browse other questions tagged or ask your own question.