From 0095769029709b531d2505ee6ad9907dd9bd72a0 Mon Sep 17 00:00:00 2001 From: Fedor Gusev Date: Wed, 11 Feb 2015 15:14:53 +0300 Subject: [PATCH] Provide g:fugitive_no_maps to disable key maps Add variable g:fugitive_no_maps. If set y and are not mapped. Resolves tpope/vim-fugitive#394 --- plugin/fugitive.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 3043208..790b277 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -193,8 +193,10 @@ function! fugitive#detect(path) abort let &mls = save_mls endtry endif - cnoremap fnameescape(recall()) - nnoremap y :call setreg(v:register, recall()) + if !exists('g:fugitive_no_maps') + cnoremap fnameescape(recall()) + nnoremap y :call setreg(v:register, recall()) + endif let buffer = fugitive#buffer() if expand('%:p') =~# '//' call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))