Skip to content

Commit

Permalink
Provide g:fugitive_no_maps to disable key maps
Browse files Browse the repository at this point in the history
Add variable g:fugitive_no_maps. If set y<C-G> and <C-R><C-G> are not
mapped.

Resolves #394
  • Loading branch information
gusevfe authored and tpope committed Feb 20, 2015
1 parent e8b9409 commit 0095769
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ function! fugitive#detect(path) abort
let &mls = save_mls
endtry
endif
cnoremap <buffer> <expr> <C-R><C-G> fnameescape(<SID>recall())
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
if !exists('g:fugitive_no_maps')
cnoremap <buffer> <expr> <C-R><C-G> fnameescape(<SID>recall())
nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
endif
let buffer = fugitive#buffer()
if expand('%:p') =~# '//'
call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))
Expand Down

0 comments on commit 0095769

Please sign in to comment.