Alex Rivera | Logout

How to prevent vim from creating (and leaving) temporary files?

Asked 2009-04-13T06:07:54.717
204

Why does vim create <filename>~ files? Is there a way to disable that?

If it's for backup (or something), I use git for that.

Also, these .<filename.with.path.hints>.swp files too.

How do I tell vim not to create those, or at the least to cleanup after itself?

EDIT

whoops, duplicate:

Why does Vim save files with a ~ extension?

I adopted rogeriopvl's answer from there.

verbatim copy:

set nobackup       "no backup files
set nowritebackup  "only in case you don't want a backup file while editing
set noswapfile     "no swap files
Edit
Report

1 Answer

67

Put this in your .vimrc configuration file.

set nobackup
answered 2009-04-13T06:10:13.400

Your Answer