1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/vimdiff.md

38 lines
701 B
Markdown
Raw Normal View History

2017-05-15 08:27:16 +12:00
# vimdiff
> Open up two or more files in vim and show the differences between them.
> See also: `vim`, `vimtutor`, `nvim`.
> More information: <https://www.vim.org>.
2017-05-15 08:27:16 +12:00
- Open two files and show the differences:
2017-05-15 08:27:16 +12:00
`vimdiff {{path/to/file1}} {{path/to/file2}}`
2017-05-15 08:27:16 +12:00
- Move the cursor to the window on the left|right:
2017-05-15 08:27:16 +12:00
`<Ctrl w>{{<h>|<l>}}`
2017-05-15 08:27:16 +12:00
- Jump to the previous difference:
2017-05-15 08:27:16 +12:00
`<[><c>`
- Jump to the next difference:
`<]><c>`
- Copy the highlighted difference from the other window to the current window:
`<d><o>`
- Copy the highlighted difference from the current window to the other window:
`<d><p>`
- Update all highlights and folds:
`<:>diffupdate`
- Toggle the highlighted code fold:
`<z><a>`