Gvim 7.1 swap and backup files
Saturday, December 27, 2008 7:45:48 AM
Well first you can turn them off with
set nobackup set nowritebackup set noswapfile
A swap file is a file that contains changes made to the original file. it matches *.swp.
A backup file is created right after saving changes to a newly opened file. it is a copy of the file before changing the file. it matches *~ where the * is the original filename.
So logically, by definition you can put them together to make the original or original plus some or all changes made.
Normally, both files appear in the directory of the file being edited. This can make the directory very cluttered, so would be better to remove it some where else. To do this use
set directory=c:/vim_swap_files set backupdir=c:/vim_swap_files
You will need to create the vim_swap_files folder before it will work.
Add the lines to the c:\program files\vim\_vimrc file or in vim edit -> startup settings and add the lines and you will never have to worry about it again.