OSDN Git Service

Regular updates
[twpd/master.git] / vim-diff.md
1 ---
2 title: Vimdiff
3 category: Vim
4 layout: 2017/sheet
5 updated: 2018-12-06
6 weight: -10
7 intro: |
8   [Vim](http://www.vim.org/) is a very efficient text editor. This reference was made for Vim 8.0.
9 ---
10
11 Getting started
12 ---------------
13 {: .-three-column}
14
15 ### Navigating
16 {: .-prime}
17
18 | Shortcut       | Description                      |
19 | ---            | ---                              |
20 | `]c`           | Next difference                  |
21 | `[c`           | Previous difference              |
22 {: .-shortcuts}
23
24 ### Editing
25
26 | Shortcut | Description                         |
27 | ---            | ---                              |
28 | `do`           | Diff Obtain! <br>Pull the changes to the current file. |
29 | `dp`           | Diff Put! <br>Push the changes to the other file. |
30 | ---            | ---                              |
31 | `:diffupdate`  | Re-scan the files for differences.                    |
32 | `ZQ`           | Quit without checking changes    |
33 {: .-shortcuts}
34
35 ### Folds
36
37 | Shortcut      | Description                  |
38 | ---           | ---                          |
39 | `zo` _/_ `zO` | Open                         |
40 | `zc` _/_ `zC` | Close                        |
41 | `za` _/_ `zA` | Toggle                       |
42 | ---           | ---                          |
43 | `zv`          | Open folds for this line     |
44 | ---           | ---                          |
45 | `zM`          | Close all                    |
46 | `zR`          | Open all                     |
47 | ---           | ---                          |
48 | `zm`          | Fold more _(foldlevel += 1)_ |
49 | `zr`          | Fold less _(foldlevel -= 1)_ |
50 | ---           | ---                          |
51 | `zx`          | Update folds                 |
52 {: .-shortcuts}
53
54
55 Also see
56 --------
57
58 - [Vim cheatsheet](https://vim.rtorr.com/) _(vim.rotrr.com)_
59 - [Vim documentation](http://vimdoc.sourceforge.net/htmldoc/) _(vimdoc.sourceforge.net)_
60 - [Interactive Vim tutorial](http://openvim.com/) _(openvim.com)_