Add . to prepopulate command line with revision

This commit is contained in:
Tim Pope 2013-03-12 02:22:02 -04:00
parent 06fafb1324
commit 09cbdded83
2 changed files with 6 additions and 1 deletions

View File

@ -258,6 +258,10 @@ P Go to the current file in the [count]th parent.
*fugitive-C* *fugitive-C*
C Go to the commit containing the current file. C Go to the commit containing the current file.
*fugitive-.*
. Start a |:| command line with the current revision
prepopulated at the end of the line.
*fugitive-a* *fugitive-a*
a Show the current tag, commit, or tree in an alternate a Show the current tag, commit, or tree in an alternate
format. format.

View File

@ -155,7 +155,7 @@ function! fugitive#detect(path)
endif endif
if exists('b:git_dir') if exists('b:git_dir')
silent doautocmd User Fugitive silent doautocmd User Fugitive
cnoremap <buffer> <expr> <C-R><C-G> <SID>recall() cnoremap <buffer> <expr> <C-R><C-G> fnameescape(<SID>recall())
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR> nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
let buffer = fugitive#buffer() let buffer = fugitive#buffer()
if expand('%:p') =~# '//' if expand('%:p') =~# '//'
@ -2302,6 +2302,7 @@ function! s:JumpInit() abort
nnoremap <buffer> <silent> cS :<C-U>exe <SID>Edit('vsplit',0,<SID>buffer().containing_commit())<CR> nnoremap <buffer> <silent> cS :<C-U>exe <SID>Edit('vsplit',0,<SID>buffer().containing_commit())<CR>
nnoremap <buffer> <silent> cO :<C-U>exe <SID>Edit('tabedit',0,<SID>buffer().containing_commit())<CR> nnoremap <buffer> <silent> cO :<C-U>exe <SID>Edit('tabedit',0,<SID>buffer().containing_commit())<CR>
nnoremap <buffer> <silent> cP :<C-U>exe <SID>Edit('pedit',0,<SID>buffer().containing_commit())<CR> nnoremap <buffer> <silent> cP :<C-U>exe <SID>Edit('pedit',0,<SID>buffer().containing_commit())<CR>
nnoremap <buffer> . : <C-R>=fnameescape(<SID>recall())<CR><Home>
endif endif
endfunction endfunction