You can achieve this by following these steps:
- Change focus to the quickfix window and navigate to the line corresponding to the commit you're interested in.
- Find the commit hash in the line and yank it (the hash is now in the
0
register.
- Close the quickfix buffer, and do
:Gdiff <C-r>0
.
That should fire up the proper diff.
You can automate steps 2 and 3 by adding this mapping to your .vimrc
file:
nnoremap <Leader>gd /\.git<CR>wwwyw<Esc>:cclose<CR>:Gdiff <C-r>0<CR>
Notice that the mapping assumes your cursor is at the beginning of the line (before the .git//
part).