Because savevers (script #89) no longer works properly with vim 7, you can see what I'm trying to do here:

autocmd BufWritePre,FileWritePre * saveas "~/backups/vim/" . % . "-" . strftime("%y%m%d-%H%M%s")

However, I'm getting an error detected. I tried putting the new name of the backup copy into a variable and using that, thus:

let filename = "~/backups/vim/" . % . "-" . strftime("%y%m%d-%H%M%s")
autocmd BufWritePre,FileWritePre * saveas filename

but of course it writes the file literally as "filename".

How can I save a timestamped copy into a directory like that?

--

.

Reply via email to