From 14735b470a790f9c3c240b9b7db0331aa695b95c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 10 Mar 2012 17:32:08 -0500 Subject: [PATCH] Use y to yank the current object's path In response to #165. --- doc/fugitive.txt | 10 ++++++++++ plugin/fugitive.vim | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index ef8aab8..bc1a707 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -201,6 +201,16 @@ that are part of Git repositories). MAPPINGS *fugitive-mappings* +These maps are available everywhere. + + *fugitive-c_CTRL-R_CTRL-G* + On the command line, recall the path to the current + object (that is, a representation of the object + recognized by |:Gedit|). + + *fugitive-y_CTRL-G* +["x]y Yank the commit SHA and path to the current object. + These maps are available in Git objects. *fugitive-* diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index c9b5779..83d8932 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -139,7 +139,8 @@ function! s:Detect(path) endif if exists('b:git_dir') silent doautocmd User Fugitive - cnoremap recall() + cnoremap recall() + nnoremap y :call setreg(v:register,recall()) let buffer = fugitive#buffer() if expand('%:p') =~# '//' call buffer.setvar('&path',s:sub(buffer.getvar('&path'),'^\.%(,|$)',''))