http://vim.wikia.com/wiki/Diff_current_buffer_and_the_original_file
原文链接:https://www.f2er.com/bash/392731.htmlHere is a function and command to see a diff between the currently edited file and its unmodified version in the filesystem. Just put this in your vimrc or in the plugin directory,open a file,make some modifications without saving them,and do
:DiffSaved
.06000
To get out of diff view you can use the
:diffoff
command.Below is a similar function,adapted to mimic the
'cvs diff'
command…