is there any way I can know all changes I made to a (existing) file before saving it in vi ? In other words any way to do "diff" between saved and edited version of a file in vi. Thanks
1 Answer
The $VIMRUNTIME/vimrc_example.vim
defines a :DiffOrig
command that does exactly that. See also :help :DiffOrig
for the description. Just copy the command definition to your ~/.vimrc
, and you're done!
:w new_file_name
and then use plain old diff.