## Configuration
```
git config —-global merge.tool vimdiff
git config —-global merge.conflictstyle diff3
```
## Window layout
The top left window shows the LOCAL buffer, the file in your target branch (what you are merging into).
The middle window (BASE) is the common ancestor (so it lets you compare how the left and right versions have diverged from each other).
The top right window shows how the file looks like on the REMOTE source (where you are merging from).
The bottom buffer contains the merged file you are creating and editing in your working directory. `vim` shows you how it differs from each of the top views, which are the areas that the automatic merge couldn't not handle.
## Making changes
Use one of the following commands in the bottom window on each highlighted diff change:
1. `:diffget LOCAL` to keep the LOCAL changes.
2. `:diffget REMOTE` to use the changes from REMOTE.
3. `:diffget BASE` if you think both REMOTE and LOCAL are wrong.
To undo a change, press `u`. After that, to highlight those changes again use `:diffupdate`
## Navigation
- Use `:cquit!` to abort the merging (with an error code for git); Or use `:qa!` and confirm to git that the merge wasn’t completed
- Use `]c` and `[c` to navigate *changes*
- Use `CTRL-w h|j|k|l` to move the cursor to the window to the left/bottom/top/right and `CTRL-w w` to simply jump to the “next” window
- Use `:close` or `CTRL-w c` to close a window, such as BASE.
- Use `CTRL-w +|-|<|>|=` to resize a window split horizontally (add/remove lines) or vertically (add/remove columns) or make them the same size
- Use `:wqa` to write the changes, quit all windows, and exit the mergetool.