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?

Popularity: 19% [?]

Related posts:

  1. Slackware 12 upgrade OK, I’ve done it. I’ve started the upgrade from...
  2. Upgrading Slackware Slackware is my Linux distribution of choice. In fact,...
  3. Vim - Multiple Files One of the very cool things about Vim is...
  4. Slackware 12 upgrade - Samba One of the challenges on any Linux upgrade is...
  5. Slackware Tips What is Slackware? Slackware is the original Linux distribution....

Related posts brought to you by Yet Another Related Posts Plugin.

3 Comments

  1. ddesani said,

    April 8, 2008 at 7:33 pm

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

  2. ed said,

    August 13, 2008 at 9:49 am

    Thanks, this solves a long-standing issue for me!

  3. Schnuff said,

    November 26, 2008 at 4:16 am

    Thanx for posting this. Good idea with the separate backup dir.

Post a Comment