Can I see changes before I save my file in Vim?
问题 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? 回答1: http://vim.wikia.com/wiki/Diff_current_buffer_and_the_original_file Here 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 . function! s:DiffWithSaved() let filetype=&ft