Skip to content

Instantly share code, notes, and snippets.

@imbilltucker
Forked from hyamamoto/vimdiff.md
Created April 8, 2019 19:00
Show Gist options
  • Save imbilltucker/f6f6cb8a1cb48098953d7d9196d7424a to your computer and use it in GitHub Desktop.
Save imbilltucker/f6f6cb8a1cb48098953d7d9196d7424a to your computer and use it in GitHub Desktop.
The vimdiff cheat sheet as a git mergetool.

vimdiff cheat sheet

This is a vimdiff cheat sheet as a git mergetool.

Commands

]c          - go to next difference  
[c          - go to previous difference  

do          - diff obtain (other to current), shortened ':diffget'  
dp          - diff put    (current to other), shortened ':diffput'  

:diffupdate - re-scan the files for differences  
:diffthis   - get a diff of files on buffers (from normal mode) 
:diffoff    - return to normal mode   
zo            - open folded text  
zc            - close folded text  

Ctrl+W Ctrl+W - switch to next window  
:ls           - show windows info 

qall!         - quit all buffers  

Windows

  1. Upper-Left
    The local/target branch
  2. Upper-Center
    The most common ancestor of the 'target' and the 'merge' branch
  3. Upper-Right
    The remote/merge branch
  4. Bottom
    The product of this merge operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment