News for hackers. Stuff that matters.
Re:Better Git configuration by ereyes01 on Thursday April 06, 2017 @03:35AM (#14048655)
I'm a long time vim user and my brain is wired to reach for the keyboard shortcuts in vimdiff to jump from diff to diff. Also, I really love diffing entire trees in one vim session using the DirDiff plugin (https://github.com/will133/vim-dirdiff).

Here's how I wire it into my .gitconfig, which gets me the alias "git dirdiff":

  [difftool "default-difftool"]
    cmd = gvim -f '+next' '+execute \"DirDiff\" argv(0) argv(1)' $LOCAL $REMOTE

  [difftool]
    prompt = false

  [alias]
    difftool --dir-diff
... I like to use gvim to open new windows separate from my terminal, but if you prefer you can just use plain vim in there as well.

Also, if using vim for viewing diffs, you might want to hack vim's config as well to make it look good. I like to (effectively) disable folding of lines with no diffs so I can still read the whole file- I use the shortcuts ]c (next diff) and [c (previous diff) to jump around diffs. I also like to disable editing in diff mode.

Here's my diff-related .vimrc hackage:

  if &diff
  	set lines=60 columns=184
  	set foldminlines=99999
  	set nomodifiable
  	set nowrite
  endif
Re:Better Git configuration by jwilk on Thursday April 06, 2017 @05:54AM (#14049212)
The last section should be:

  [alias]
    dirdiff = difftool --dir-diff
Re:Better Git configuration by ereyes01 on Thursday April 06, 2017 @04:14PM (#14054171)
Copy/paste fail... Thanks for catching