Since upgrading to Slackware 12 I’ve noticed vim creates backups of every file I edit by appending the file with a tilde (~).
looks like this is a compilation option for vim 7.1 that comes with Slackware 12. My previous install did not do this, so I’m guessing the compile options were changed for Slackware 12. I confirmed this by running
vim –version
One of the options that is set is
+writebackup
No problem with vim writing backups, in fact it can be good. Only problem I have with it is when I’m working on one of my web development projects I have to be careful not to ftp all of these extra files up to the server. There are two options.
I could disable the backup for vim by adding this to .vimrc
:set nobackup
The other, and better, option is to set a dedicated backup directory
:set backupdir=~/.backup,.,/tmp
Now all of the backup files get created in a single .backup directory. This isn’t a perfect solution. Files with identical names (index.html) will get overwritten, but I’ve never once used a vim backup file, so this is still better than nothing.
For more informations, you might read this article
Are *.swp and *~ files littering your working directory?
Hi.. I’m brazilian and my english is not good =D..
Just thanks about your post
Hi.. I’m brazilian and my english is not good =D..
Just thanks about your post
Thanks, this solves a long-standing issue for me!
Thanks, this solves a long-standing issue for me!
Thanx for posting this. Good idea with the separate backup dir.
Thanx for posting this. Good idea with the separate backup dir.