Not using versioning on your configuration files and editing them with Vim? Use Vim’s backup option to automatically keep a copy of past versions:
To put in your ~/.vimrc
:
"Turn on backup option
set backup
"Where to store backups
set backupdir=~/.vim/backup//
"Make backup before overwriting the current buffer
set writebackup
"Overwrite the original backup file
set backupcopy=yes
"Meaningful backup name, ex: filename@2015-04-05.14:59
au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")
Hi @nepsilon
if i want to backup a file before editing after the editing with the unique name .. how can i achive that? :| can you please help me on this..
and this is not working for me (au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")) :|
Looking forward your responce...