Wednesday, September 2, 2009

VIM tip of the day!

Ever wondered how to avoid VIM creating those annoying backup files like foo~ ?

Add the following to your vimrc:

" Don't backup files like foo~
set nobackup
set nowritebackup


4 comments:

Sankar said...

Sorry for nitpicking, The filename~ backup will be created by gedit. AFAIK, vim creates .filename.swp etc.

I am surprised why it should be annoying. It is hidden and gets automatically cleared on exit.

Suresh said...

@Sankar: It creates swap files by name .filename.swp but backup files by name filename~. Perhaps gedit too creates such files, but vim for sure creates such files.

Ever used quilt for managing multiple files..?

Anonymous said...

There were instances when these backup files saved me (But with GIT i dont need these anymore).

But instead of switching off this I ask emacs to create them in a single directory (~/.backups)

Suresh said...

@johnnyjacob: good idea. It might be useful to dump them in a different directory. I think with vim too one should be able to do that.