logo

Handy vim tip
I've been working on a number of bits of code recently, and have found that it's not entirely practical to check into RCS or SVN for every change that I've made. I really like to work by committing when I've finished adding a feature to a script, or a project. Hence, I've been using the vim "set backup" option. However, this has some limitations, and hence I decided to have a look at what .vimrc could do for me.

  set backupdir=~/.vimbackup/
  let d = strftime("-%d%m%y-%H%M")
  let d = "set backupext=".d
  execute d
  set backup            
Now I have backup files in ~/.vimbackup/ that reflect the time I started editing the file. This is quite handy if you, like me, :wq! and execute when testing. I'll probably need to write a script to cleanup ~/.vimbackup at some point though!

Tagged in: Geek, Work
 
previous posts
contact details
gps logs
 
Fran Buckland [people]
hippy [people]
Andy Davidson [people]
Gem Atkinson [people]
rjs ssh key [tech]
rjs pgp key [tech]
londonfgss [cycling]
Rollapaluza [cycling]
CS Grupetto [cycling]
atom [rob.sh]
notebooks [rob.sh]
admin [rob.sh]
rss [rob.sh]
Stolen Bikes [london]
inhabitat [green]
core77 [design]