Provide :Gclog and :Gcgrep aliases

The distant future might hold a :Glog command that isn't bound by the
limitations of the quickfix list, so introduce an alias for the quickfix
variant to retire to.

:Gcgrep is a weird name since it directly maps to :grep, but provide it
anyways for symmetry.
This commit is contained in:
Tim Pope 2019-07-11 09:23:39 -04:00
parent e250f9730e
commit a1a40c360d
2 changed files with 4 additions and 2 deletions

View File

@ -3502,8 +3502,10 @@ function! s:Log(type, bang, line1, count, args) abort
endfunction
call s:command("-bar -bang -nargs=? -complete=customlist,s:GrepComplete Ggrep :execute s:Grep('c',<bang>0,<q-args>)")
call s:command("-bar -bang -nargs=? -complete=customlist,s:GrepComplete Gcgrep :execute s:Grep('c',<bang>0,<q-args>)")
call s:command("-bar -bang -nargs=? -complete=customlist,s:GrepComplete Glgrep :execute s:Grep('l',<bang>0,<q-args>)")
call s:command("-bar -bang -nargs=? -range=-1 -complete=customlist,s:LogComplete Glog :exe s:Log('c',<bang>0,<line1>,<count>,<q-args>)")
call s:command("-bar -bang -nargs=? -range=-1 -complete=customlist,s:LogComplete Gclog :exe s:Log('c',<bang>0,<line1>,<count>,<q-args>)")
call s:command("-bar -bang -nargs=? -range=-1 -complete=customlist,s:LogComplete Gllog :exe s:Log('l',<bang>0,<line1>,<count>,<q-args>)")
" Section: :Gedit, :Gpedit, :Gsplit, :Gvsplit, :Gtabedit, :Gread

View File

@ -66,13 +66,13 @@ that are part of Git repositories).
*fugitive-:Gfetch*
:Gfetch [args] Like |:Gpush|, but for git-fetch.
*fugitive-:Ggrep*
*fugitive-:Ggrep* *fugitive-:Gcgrep*
:Ggrep[!] [args] |:grep|[!] with git-grep as 'grepprg'.
*fugitive-:Glgrep*
:Glgrep[!] [args] |:lgrep|[!] with git-grep as 'grepprg'.
*fugitive-:Glog*
*fugitive-:Glog* *fugitive-:Gclog*
:Glog[!] [args] Use git-log [args] to load the commit history into the
|quickfix| list. Jump to the first commit unless [!]
is given.