created 2006 · complexity intermediate · author Leif Arne Storset · version 6.0
If you use SubVersion for version control (http://subversion.tigris.org) you will naturally already have set your EDITOR environment variable to 'vim' or 'gvim -f' so you can write commit messages in Vim. But you will also want to view the diff so you can write sensible comments in the log. Opening the diff manually is tedious, so here is a mapping for the F9 key:
map <F9> :new<CR>:read !svn diff<CR>:set syntax=diff buftype=nofile<CR>gg
This opens a new buffer, reads the SVN diff, sets syntax highlighting and tells Vim not to save the buffer, and places the cursor at the top. Since the buffer won't be saved, you may quit using
:wqa when you're finished writing the commit message.