From e7c7149434e819ed385bec004a45a222f74e3f1f Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 7 Apr 2014 05:00:22 -0400 Subject: [PATCH] Map both g? and to show help Closes #273. --- doc/fugitive.txt | 3 ++- plugin/fugitive.vim | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index f4392e2..5870837 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -34,7 +34,7 @@ that are part of Git repositories). window. The following maps, which work on the cursor line file where sensible, are provided: - this help + g? show this help next file previous file |:Gedit| @@ -178,6 +178,7 @@ that are part of Git repositories). along to git-blame. The following maps, which work on the cursor line commit where sensible, are provided: + g? show this help A resize to end of author column C resize to end of commit column D resize to end of date/time column diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index ee675aa..0f779d2 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1705,6 +1705,8 @@ function! s:Blame(bang,line1,line2,count,args) abort setlocal norelativenumber endif execute "vertical resize ".(s:linechars('.\{-\}\ze\s\+\d\+)')+1) + nnoremap :help fugitive-:Gblame + nnoremap g? :help fugitive-:Gblame nnoremap q :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w'.bufnr('').'bdelete','^-1','','') nnoremap gq :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w'.bufnr('').'bdeleteif expand("%:p") =~# "^fugitive:[\\/][\\/]"Geditendif','^-1','','') nnoremap :exe BlameCommit("exe 'norm q'edit") @@ -2143,6 +2145,7 @@ function! s:BufReadIndex() abort xnoremap p :execute StagePatch(line("'<"),line("'>")) nnoremap q :if bufnr('$') == 1quitelsebdeleteendif nnoremap R :edit + nnoremap g? :help fugitive-:Gstatus nnoremap :help fugitive-:Gstatus catch /^fugitive:/ return 'echoerr v:errmsg'