From 09cbdded837a8ae6f1f510981abc066b259fd241 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 12 Mar 2013 02:22:02 -0400 Subject: [PATCH] Add . to prepopulate command line with revision --- doc/fugitive.txt | 4 ++++ plugin/fugitive.vim | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 612ee39..f40afcf 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -258,6 +258,10 @@ P Go to the current file in the [count]th parent. *fugitive-C* 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* a Show the current tag, commit, or tree in an alternate format. diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index ab4b6bc..de4b52c 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -155,7 +155,7 @@ function! fugitive#detect(path) endif if exists('b:git_dir') silent doautocmd User Fugitive - cnoremap recall() + cnoremap fnameescape(recall()) nnoremap y :call setreg(v:register, recall()) let buffer = fugitive#buffer() if expand('%:p') =~# '//' @@ -2302,6 +2302,7 @@ function! s:JumpInit() abort nnoremap cS :exe Edit('vsplit',0,buffer().containing_commit()) nnoremap cO :exe Edit('tabedit',0,buffer().containing_commit()) nnoremap cP :exe Edit('pedit',0,buffer().containing_commit()) + nnoremap . : =fnameescape(recall()) endif endfunction