Let’s say I’m editing a file in vim, and I save (1). I continue editing, and I save again (2). Is it possible to “delete” this last save — meaning that vim would leave the file in its current state, but thinking the last save was 1?
To clarify, I open a file and write
one
two
I save it. Then I continue editing it, so it’s now
one
two
three
four
Now I need to save it in this state, and right after that do something (this is what I want to know) that will make vim still show me
one
two
three
four
but that if I close the file (or revert it with :e!
, it’ll be at the state of
one
two
I want to do this because I use processing, and to use it with an external editor it relies on an external program that acts on the file, which means it needs to be saved, so the program can act upon the desired state of the file. Sometimes, however, I have a saved file and want to make a few changes just to test the result. However, if I don’t like the result, I’m “stuck” with this new saved version (unless I remember exactly how many times I would need to undo to get the previous saved state), and I’m looking for a way to chain this to the command that saves the file and runs the program against it.