Peter's Blog

Gvim 7.1 swap and backup files

, ,

What is the difference ?

Well first you can turn them off with

set nobackup
set nowritebackup
set noswapfile


source: http://thehumblecoder.wordpress.com/2006/08/08/vim-swap-and-backup-files/

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.
source: http://www.ph.unimelb.edu.au/~ssk/vim/recover.html

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.

Ad blocking and Spell Checkautorun.inf virus on usb and harddrive

Write a comment

New comments have been disabled for this post.

May 2013
M T W T F S S
April 2013June 2013
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31