Skip to content

Instantly share code, notes, and snippets.

@epcim
Last active November 28, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epcim/7d1d5f3837ab386262a26ddca6a6dca0 to your computer and use it in GitHub Desktop.
Save epcim/7d1d5f3837ab386262a26ddca6a6dca0 to your computer and use it in GitHub Desktop.
vimdiff diff dirdiff git

DirDiff - https://www.vim.org/scripts/script.php?script_id=102

Configuration

" Dirdiff
let g:DirDiffEnableMappings = 1
let g:DirDiffExcludes = "system,CVS,*.class,*.exe,.*.swp,pbgo*,pbdoc*,pbswagger*,pbccp*,_extschema*,*.lock"

CLI

vim "+DirDiff $FILE1 $FILE2"

With git (difftool: git d HEAD~3)

[diff]
  tool = meld # see the ~/bin/meld workarround below
  
[alias]
    d   = difftool --dir-diff

With mu_repo (on cmd like: mu upd)

~/bin/meld:

#!/bin/sh
# Wrapper for `mu-repo` aka `mu dd` or `mu upd`, to run diff it calls actually just "meld"
args="+DirDiff ${@}"
vim "$args"

advanced / related

configuration - https://minimul.com/compare-and-merge-directories-with-dirdiff.html git diff with tabs - https://stackoverflow.com/questions/2428051/how-can-i-view-multiple-git-diffs-side-by-side-in-vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment