Guest User

Untitled

a guest
Sep 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # shell wrapper to use gvimdiff and vimdiff as git differ.
  4.  
  5. # set up your ~/.gitconfig like this to use it:
  6.  
  7. #[diff]
  8. # external = gitdiff.sh
  9. #
  10. #[pager]
  11. # diff =
  12. # ndiff = less
  13. #
  14. #[alias]
  15. # ndiff = diff --no-ext-diff
  16.  
  17. # The ndiff alias is the "normal diff" in case you don't want to use vimdiff some times.
  18.  
  19. # This will use gvimdiff in a graphical environment (DISPLAY is set), and run a
  20. # in-terminal vimdiff if not.
  21.  
  22. if [ -n "$DISPLAY" ] ; then
  23. DIFF="/usr/local/bin/gvimdiff -RMmf"
  24. else
  25. DIFF="/usr/local/bin/vimdiff -RMm"
  26. fi
  27.  
  28. LEFT=${2}
  29. RIGHT=${5}
  30.  
  31. exec $DIFF $LEFT $RIGHT
Add Comment
Please, Sign In to add comment