Backups (recover) disabled by default: no backups

Bug #151791 reported by Jeffrey Knight
2
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Binary package hint: vim

I accidentally deleted some files I was working on, and wasn't too worried because I knew I could grab the swap file and :recover.

Much to my surprise, I had none.
I searched my entire file system and, sure enough, no vim backup files.

It wasn't until I added these to my vimrc that backups became enabled:
set backup
set writebackup

Some type of backup should be enabled by default. I understand not wanting to clutter
users' directories with ~backup files, so perhaps backups could default to /tmp.

This has been confirmed by David Portwood on Feisty and Gutsy:
https://answers.edge.launchpad.net/ubuntu/+source/vim/+question/14861

Changed in vim:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
James McCoy (jamessan) wrote :

There are various modes that Vim uses for backups. By default ("set nobackup", "set writebackup"), a backup file is created just before saving and if the save is successful it is deleted. You can see a full explanation of the different backup behavior at ":help backup-table". You may also be interested in the 'backupdir' option in order to configure where Vim stores the backup files.

Backups are completely independent of the :recover command, though. That command is used to restore from a swap file, which would exist if Vim crashed while you were in the middle of editing or you lost power or something drastic along those lines.

So, in Vim's default configuration it does create both backup and swap files, but only temporally -- they're deleted as soon as they're not needed. This prevents littering the system with many extraneous files while still providing safeguards. That is the proper default behavior IMO and if you want different behavior, then you can configure Vim to behave differently.

Will Gray (graywh)
Changed in vim (Ubuntu):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.