Friday, May 11, 2012

same backup dir, files same name

Hi,

I am using Windows 7, vim 7.3

I am using the same backup directory for all of the files I edit. I
would like to make it so that if I edit two files with the same name
in different directories, the backup filenames would be different.

I found this on the web:

" Prevent backups from overwriting each other. The naming is weird,
" since I'm using the 'backupext' variable to append the path.
" So the file '/home/docwhat/.vimrc' becomes '.vimrc%home%docwhat~'
au BufWritePre * let &backupext = '@' . substitute(expand('%:p:h'),
'/', '%', 'g') . '~'


But when I add it to my _gvimrc, it has no effect. Everything else in
in _gvimrc works.

It still always just saves the backup file with a ~ at the end of the
filename. How can I change it so that I'm editing two files with the
same name in different directories, they will have different backup
filenames.

- Doug




--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: