Eric Leenman wrote:
I've tried it but then I get the message :
Error E510 'Can't backup file (add! to override)



I have a clean gvim70.exe downloaded today.
I've added two lines to my _vimrc, see below for the complete file.
Do I need to do something with backup and write backup?

[start _vimrc]
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin


" Disclaimer: the following is untested
" -------------------------------------
if ! isdirectory($VIM . '/backup')
        silent! !mkdir $VIM/backup
        if ! isdirectory($VIM . '/backup')
                echoerr "Backup directory does not exist"
                \       "and cannot be created"
        endif
endif

set bdir=$VIM/backup
let &bex = '-' . strftime("%Y%b%d%X") . '~'
[end _vimrc]

'backupext' is here set to the date-time when the vimrc was sourced. If a file is edited and saved several times in a single session, all backups will (IIUC) overwrite one another.




For now I've used gvim63.exe
There I used tip 892 (http://www.vim.org/tips/tip.php?tip_id=892)
But this doesn't work anymore in 6.4 and 7.0
I'm trying to get this backup options functional in 7.0 again, but until now unsuccesfull.



Best regards,
Tony.

Reply via email to