View local changes made in a file
Eclipse and, in a way, TortoiseSVN allow viewing the local changes in a file before you commit it for eternity, in the repository. But I wanted a way to view just the changes I have done to the file, before saving it. Fortunately VIM provides this in a nice and easy way, as it was pointed to me by someone on irc://vim@freenode.net. You can define a new command, DiffOrig, which splits the current buffer window and shows you the diffs to the previously saved version.
The command to add in your vimrc is (according to the 'diff' chapter in the help file):
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis
To use it, just do :DiffOrig in the desired buffer window.
