Skip to content

Instantly share code, notes, and snippets.

@kujiy
Forked from hyamamoto/vimdiff.md
Last active August 7, 2018 22:51
Show Gist options
  • Save kujiy/d03ac18547421b28f0d7c287e5b52d45 to your computer and use it in GitHub Desktop.
Save kujiy/d03ac18547421b28f0d7c287e5b52d45 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 

:wall          - save all windows  
:wqall         - save and quit all windows  
:qall          - quit all windows  
:qall!         - discard all changes and close windows  

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