Use y<C-G> to yank the current object's path

In response to #165.
This commit is contained in:
Tim Pope
2012-03-10 17:32:08 -05:00
parent 22c8ffa2ba
commit 14735b470a
2 changed files with 12 additions and 1 deletions

View File

@@ -139,7 +139,8 @@ function! s:Detect(path)
endif
if exists('b:git_dir')
silent doautocmd User Fugitive
cnoremap <expr> <buffer> <C-R><C-G> <SID>recall()
cnoremap <buffer> <expr> <C-R><C-G> <SID>recall()
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register,<SID>recall())<CR>
let buffer = fugitive#buffer()
if expand('%:p') =~# '//'
call buffer.setvar('&path',s:sub(buffer.getvar('&path'),'^\.%(,|$)',''))