I use Vim. I open a file. I edit it and I want to see what I\'ve edited before I save it.
How can I do this in Vim?
Not exactly what you're looking for but SCMDiff.vim is really cool. One keypress, and it diff-highlights your current file with the head revision in a source control repo. It's meant to work with many SCMS. I use it with perforce.
git supports the following command
:w !git diff --no-index -- % -
map it to a command by adding the following to your ~/.vimrc
command GitDiff execute "w !git diff --no-index -- % -"
Now executing :GitDiff
becomes a handy little command to quickly show the diff before each save.