Turn off auto backup for GVim in Windows

Problem:
gvim will create a backup file with the suffix "~" by default.
I don’t want keep the backup file.


Solution:

Problem:
gvim will create a backup file with the suffix "~" by default.
I don’t want keep the backup file.


Solution:

change the following script in vimrc_example.vim
if has("vms")

  set nobackup    " do not keep a backup file, use versions instead

else

  set backup         " keep a backup file
to:
if has("vms")

  set nobackup       " do not keep a backup file, use versions instead

"else

"  set backup           " keep a backup file

Tips:

vimrc_example.vim is in the location:
$VIMRUNTIME/vimrc_example.vim
you can use :echo $VIMRUNTIME to get the path

Leave a Reply

Your email address will not be published. Required fields are marked *