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?

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. Slackware 12 upgrade OK, I’ve done it. I’ve started the upgrade from Slackware...
  2. Vim – Multiple Files One of the very cool things about Vim is the...
  3. Upgrading Slackware Slackware is my Linux distribution of choice. In fact, I...