1

I tried -U9("--unified") and git config --global diff.context - it affects only git diff but neither git difftool (I prefer vimdiff) nor git commit -p (commit by hunks).

phd
  • 82,685
  • 13
  • 120
  • 165
Vitaly Zdanevich
  • 13,032
  • 8
  • 47
  • 81

1 Answers1

1

Add this into .vimrc: :set diffopt=filler,context:9

See more at http://vimdoc.sourceforge.net/htmldoc/options.html#'diffopt'

Also you can toggle fold:

The command zc will close a fold (if the cursor is in an open fold), and zo will open a fold. It's easier to just use za which will toggle the current fold (close it if it was open, or open it if it was closed). Source: https://vim.wikia.com/wiki/Folding

git difftool vimdiff folding golang

Vitaly Zdanevich
  • 13,032
  • 8
  • 47
  • 81