casouri / vundo

Visualize the undo tree.
413 stars 20 forks source link

Remove all undo/redo history for current buffer? #108

Open fapdash opened 1 week ago

fapdash commented 1 week ago

Is there a way to throw away all undo/redo history information for the current buffer?

I try to do this in the following scenarios:

  1. When I accidentally yanked / pasted in a secret that I don't want to accidentally show on undo.
  2. To keep my history clean once I'm certain that I don't need any earlier history for that particular file

Of course this would also help for https://github.com/casouri/vundo/issues/68.

jdtsmith commented 4 hours ago

M-: (setq buffer-undo-list nil) is a heavy hammer that works. I sometimes reach for it when history is too deep. I do still wish for a command to specify a time frame (e.g. two weeks) and remove anything on the undo list "older" than that. That would only work for buffers which had been saved to file.