Slackware 12 upgrade – vim backup files

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?

Bob Weber

My name is Bob Weber and I live in Greeley Colorado. This blog is my personal views, ideas, comments, etc.. You will probably learn more about me by reading the entries here than you will in this bio.

6 thoughts to “Slackware 12 upgrade – vim backup files”

  1. Hi.. I’m brazilian and my english is not good =D..
    Just thanks about your post

  2. Hi.. I’m brazilian and my english is not good =D..
    Just thanks about your post

Comments are closed.