Skip to content

Instantly share code, notes, and snippets.

@qvacua
Last active March 12, 2019 09:09
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 qvacua/3fed034df549d79852d731e3f2ef2dd9 to your computer and use it in GitHub Desktop.
Save qvacua/3fed034df549d79852d731e3f2ef2dd9 to your computer and use it in GitHub Desktop.
gitconfig and VimR command for git difftool with DirDiff.vim
[difftool "vimrdiff"]
cmd = vimr --wait --nvim '+au GUIEnter * execute \"DirDiff\" argv(0) argv(1)' '+au GUIEnter * VimRDirDiff' $LOCAL $REMOTE
[diff]
tool = vimrdiff
# When you now use git difftool, then the VimR window will be maximized and all tools hidden.
# And these settings will not be persisted
function! s:VimRTempMaxWin() abort
VimRMakeSessionTemporary " The tools, tool buttons and window settings are not persisted
VimRHideTools
VimRMaximizeWindow
endfunction
command! -nargs=0 VimRTempMaxWin call s:VimRTempMaxWin()
function! s:VimRDifDiff() abort
VimRTempMaxWin
sleep 500m " Yes, ugly, but I could not find a better solution.
normal o " Select the first file (again) to resize the panes.
endfunction
command! -nargs=0 VimRDirDiff call s:VimRDirDiff()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment