To compare two files with vimdiff, you just need to run the vimdiff command with the path of the files you want to compare:
vimdiff file1 file2Then, you will see something like below:
You can edit the files as a normal Vim editor. However, I would like to highlight some useful commands in diff mode of vim:
- ]c
- Jump to next change
- ]c
- Jump to prev change
- do
- Update the current change by copying the change of another buffer.
- dp
- Update change of another buffer by copying the current change of this buffer.
- Ctrl-w Ctrl-w
- Switch to another buffer
No comments:
Post a Comment