I set up my vimrc to use the :make and debugging facilities, adding in support for subversion in the process. I tried svncommand but it didn't work for whatever reason, and I figured I'd learn a bunch by hacking it into my config. You need vim 7 or higher to use the readfile() function in SvnDiff(), so upgrade already! ;)
I also updated the new file initialization to look less lame.
I changed out the vim7-only readfile() for vim6-and-maybe-earlier getfsize(). I also changed out the normal mode ",sd" shortcut to a command mode abbreviation.
I simplified SvnDiff() to just echo the diff as using QuickFix buffers to store diff entries that have dates (e.g. Mon May 14 22:01:17 GMT 2007) will cause QuickFix to puke.
" support subversion
" svn diff output goes in the quickfix buffer
" svn commit opens a comment buffer with g:SvnEditCommand and creates callback with an autocmd
" to call SvnCommitPost() on write,
" if you're on windows, you might have to prefix the filenames with \c for case-insensitivity
let diff = system(g:SvnExecutable . " diff " . expand("%") )
if strlen(diff) > 0
echo "No Difference!"
let file = expand('%')
let mesg = tempname()
execute g:SvnEditCommand . ' ' . mesg
execute "augroup Svn"
execute 'autocmd BufWritePost ' . mesg . ' call SvnCommitPost("' . file . '","' . mesg . '")'
execute "augroup END"
function SvnCommitPost(file, mesg)
echo system(g:SvnExecutable . ' commit -F ' . a:mesg . ' ' . a:file)
" map subversion
cabbr svnd call SvnDiff()
cabbr svnc call SvnCommit()
" new file? fill it with a skeleton
if a:type == "py"
execute setline(1, "#!/usr/bin/python")
elseif a:type == "pl"
execute setline(1, ["#!/usr/bin/perl", "use warnings;", "use strict;"])
elseif a:type == "sh"
execute setline(1, "#!/bin/bash")
execute "normal Go"
" empty autocmd and re-fill
autocmd BufNewFile *.py call InitNewFile("py")
autocmd BufNewFile *.sh call InitNewFile("sh")
autocmd BufNewFile *.pl call InitNewFile("pl")