2017-05-14 21:27:16 +01:00
|
|
|
# vimdiff
|
|
|
|
|
2020-12-14 13:03:56 +00:00
|
|
|
> Open up two or more files in vim and show the differences between them.
|
|
|
|
> See also `vim`.
|
|
|
|
> More information: <https://www.vim.org>.
|
2017-05-14 21:27:16 +01:00
|
|
|
|
2020-12-14 13:03:56 +00:00
|
|
|
- Open two files and show the differences:
|
2017-05-14 21:27:16 +01:00
|
|
|
|
|
|
|
`vimdiff {{file1}} {{file2}}`
|
|
|
|
|
2020-12-14 13:03:56 +00:00
|
|
|
- Move the cursor to the window on the left|right:
|
2017-05-14 21:27:16 +01:00
|
|
|
|
2020-12-14 13:03:56 +00:00
|
|
|
`Ctrl + w {{h|l}}`
|
2017-05-14 21:27:16 +01:00
|
|
|
|
2020-12-14 13:03:56 +00:00
|
|
|
- Jump to the next difference:
|
2017-05-14 21:27:16 +01:00
|
|
|
|
2020-12-14 13:03:56 +00:00
|
|
|
`[c`
|
|
|
|
|
|
|
|
- Jump to the previous difference:
|
|
|
|
|
|
|
|
`]c`
|
|
|
|
|
|
|
|
- Copy the highlighted difference from the other window to the current window:
|
|
|
|
|
|
|
|
`do`
|
|
|
|
|
|
|
|
- Copy the highlighted difference from the current window to the other window:
|
|
|
|
|
|
|
|
`dp`
|
|
|
|
|
|
|
|
- Update all highlights and folds:
|
|
|
|
|
|
|
|
`:diffupdate`
|
|
|
|
|
|
|
|
- Toggle the highlighted code fold:
|
|
|
|
|
|
|
|
`za`
|