" Make a backup (i. e. 'file~') and save it.
set backup
-" create ~/tmp/ if it doesn't exist and use ~/tmp to save the
-" backups into
+" create ~/tmp/vimbak if it doesn't exist and use it to save the backups
if has("unix")
- if !isdirectory(expand("~/tmp/vimbak/."))
- !mkdir -p ~/tmp/vimbak
- endif
+ if !isdirectory(expand("~/tmp/vimbak/."))
+ !mkdir -p ~/tmp/vimbak
+ endif
+ set backupdir=~/tmp/vimbak
endif
-set backupdir=~/tmp/vimbak
+
+" Create backups by copying files to backup directory instead of renaming
+set backupcopy=yes
+
+" Use modelines
+set modelines=5