diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9169239..9cec810 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1844,6 +1844,8 @@ function! fugitive#BufReadStatus() abort nnoremap d? :help fugitive_d nnoremap P :execute StagePatch(line('.'),line('.')+v:count1-1) xnoremap P :execute StagePatch(line("'<"),line("'>")) + call s:Map('n', 'p', ":if v:countsilent exe GF('pedit')elseechoerr 'Use = for inline diff, P for :Git add/reset --patch, 1p for :pedit'endif", '') + call s:Map('x', 'p', ":execute StagePatch(line(\"'<\"),line(\"'>\"))", '') nnoremap I :execute StagePatch(line('.'),line('.')) xnoremap I :execute StagePatch(line("'<"),line("'>")) if empty(mapcheck('q', 'n')) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 0198d1a..b30515a 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -332,6 +332,11 @@ gO Open the file or |fugitive-object| under the cursor in O Open the file or |fugitive-object| under the cursor in a new tab. + *fugitive_p* +p Open the file or |fugitive-object| under the cursor in + a preview window. In the status buffer, 1p is + required to bypass the legacy usage instructions. + *fugitive_~* ~ Open the current file in the [count]th first ancestor.