README: document git mergetool use case

pull/83/head
Marco Hinz 6 years ago
parent da0484ce8d
commit c70b5cd346
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F

@ -145,7 +145,31 @@ Happy hacking!
```
</details>
## Typcial use cases
## Typical use cases
- **Use nvr as git mergetool.**
If you want to use nvr for `git difftool` and `git mergetool`, put this in
your gitconfig:
```
[diff]
tool = nvr
[difftool "nvr"]
cmd = nvr -s -d $LOCAL $REMOTE
[merge]
tool = nvr
[mergetool "nvr"]
cmd = nvr -s -d $LOCAL $BASE $REMOTE $MERGED -c 'wincmd J | wincmd ='
```
`nvr -d` is a shortcut for `nvr -d -O` and acts like `vim -d`, thus it uses
`:vsplit` to open the buffers. If you want them to be opened via `:split`
instead, use `nvr -d -o`.
When used as mergetool and all four buffers got opened, the cursor is in the
window containing the $MERGED buffer. We move it to the bottom via `:wincmd
J` and then equalize the size of all windows via `:wincmd =`.
- **Open files from within `:terminal` without starting a nested nvim.**

Loading…
Cancel
Save