From b3a8be6975dcc27b523b030bf5d35d9c737aef18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Sat, 5 Nov 2016 17:20:24 +0100 Subject: [PATCH] Add shortcuts for getting hunks from other views of the diff. (#801) Fixes #798 --- plugin/fugitive.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index cb8f732..1f26ec3 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1776,13 +1776,17 @@ function! s:Diff(vert,keepfocus,...) abort let nr = bufnr('') execute 'leftabove '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`' execute 'nnoremap dp :diffput '.nr.'diffupdate' + let nr2 = bufnr('') call s:diffthis() wincmd p execute 'rightbelow '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`' execute 'nnoremap dp :diffput '.nr.'diffupdate' + let nr3 = bufnr('') call s:diffthis() wincmd p call s:diffthis() + execute 'nnoremap d2o :diffget '.nr2.'diffupdate' + execute 'nnoremap d3o :diffget '.nr3.'diffupdate' return post elseif len(args) let arg = join(args, ' ')