Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by kazinator

4 years ago

I just found that the Vim manual recommends, right in the doc for backupext, the use of the BufWritePre hook instead, so:

  :au BufWritePre * let &backupext=("." . strftime("%y-%m-%d.%H:%M:%S"))

This has the right effect that every time you save with :w, a new backup is made of the previous contents.

0 comments

kazinator

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities