I followed add-custom-header-to-your-file to create my own custom header plugin. When I save the file it will auto. update the current date time to Last-Modified field. But this will add a edit history to undo list. How can I disable the undo temporary ?
You cannot disable undo without losing the undo history. Think about the undo implementation; would be pretty hard if you had a gap in there.
If you don't worry about losing the history,
:set undolevels=-1
(and then restoring to the previous value) will do. Also, :undojoin can be used to fuse two otherwise separate entries together. But in your situation, it's probably best to keep the (automated) change inside the undo history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With