mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-11 13:03:45 -05:00
Make maps buffer-local.
This commit is contained in:
@@ -167,45 +167,10 @@ command! -bar GitGutterDebug call gitgutter#debug#debug()
|
||||
nnoremap <silent> <expr> <Plug>GitGutterNextHunk &diff ? ']c' : ":\<C-U>execute v:count1 . 'GitGutterNextHunk'\<CR>"
|
||||
nnoremap <silent> <expr> <Plug>GitGutterPrevHunk &diff ? '[c' : ":\<C-U>execute v:count1 . 'GitGutterPrevHunk'\<CR>"
|
||||
|
||||
if g:gitgutter_map_keys
|
||||
if !hasmapto('<Plug>GitGutterPrevHunk') && maparg('[c', 'n') ==# ''
|
||||
nmap [c <Plug>GitGutterPrevHunk
|
||||
endif
|
||||
if !hasmapto('<Plug>GitGutterNextHunk') && maparg(']c', 'n') ==# ''
|
||||
nmap ]c <Plug>GitGutterNextHunk
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
nnoremap <silent> <Plug>GitGutterStageHunk :GitGutterStageHunk<CR>
|
||||
nnoremap <silent> <Plug>GitGutterUndoHunk :GitGutterUndoHunk<CR>
|
||||
nnoremap <silent> <Plug>GitGutterPreviewHunk :GitGutterPreviewHunk<CR>
|
||||
|
||||
if g:gitgutter_map_keys
|
||||
if !hasmapto('<Plug>GitGutterStageHunk') && maparg('<Leader>hs', 'n') ==# ''
|
||||
nmap <Leader>hs <Plug>GitGutterStageHunk
|
||||
endif
|
||||
if !hasmapto('<Plug>GitGutterUndoHunk') && maparg('<Leader>hu', 'n') ==# ''
|
||||
nmap <Leader>hu <Plug>GitGutterUndoHunk
|
||||
endif
|
||||
if !hasmapto('<Plug>GitGutterPreviewHunk') && maparg('<Leader>hp', 'n') ==# ''
|
||||
nmap <Leader>hp <Plug>GitGutterPreviewHunk
|
||||
endif
|
||||
|
||||
if !hasmapto('<Plug>GitGutterTextObjectInnerPending') && maparg('ic', 'o') ==# ''
|
||||
omap ic <Plug>GitGutterTextObjectInnerPending
|
||||
endif
|
||||
if !hasmapto('<Plug>GitGutterTextObjectOuterPending') && maparg('ac', 'o') ==# ''
|
||||
omap ac <Plug>GitGutterTextObjectOuterPending
|
||||
endif
|
||||
if !hasmapto('<Plug>GitGutterTextObjectInnerVisual') && maparg('ic', 'x') ==# ''
|
||||
xmap ic <Plug>GitGutterTextObjectInnerVisual
|
||||
endif
|
||||
if !hasmapto('<Plug>GitGutterTextObjectOuterVisual') && maparg('ac', 'x') ==# ''
|
||||
xmap ac <Plug>GitGutterTextObjectOuterVisual
|
||||
endif
|
||||
endif
|
||||
|
||||
" }}}
|
||||
|
||||
" Autocommands {{{
|
||||
|
||||
Reference in New Issue
Block a user