You can list the changes by typing :changes
or use the :DiffOrig
after putting in your .vimrc
the command below to see the changes made to the original file:
command! DiffOrig rightbelow vertical new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis
Explanation:
- command DiffOrig rightbelow vertical new
Create a new command named DiffOrig
which will split a new empty vertical window and move cursor to it.
Now we have two buffers if you type :buffers
or :files
or :ls
it will list all the existed buffers where each one has a unique id number and a name:
. The current buffer (where the cursor is active) is called %
. The buffer where the cursor was previously is called #
Set the buffertype
of the new buffer to nofile
Put the content of the alternate buffer (original one) in the current buffer (%) (after the line where the command is executed) (the content will be the last saved status)
Delete the line to move the content one line up.
Activate diff in the buffer in order to display the changes.
Move to the other buffer window (the command is same as ctrl-w p
)
Activate diff in this buffer too to display the changes.