Add hunk previewing.

This commit is contained in:
Andy Stewart
2014-03-17 15:46:30 +01:00
parent 9c66906d56
commit 0ca3f7e3cd
5 changed files with 58 additions and 11 deletions

View File

@@ -77,8 +77,9 @@ command GitGutterSignsToggle call gitgutter#signs_toggle()
command -count=1 GitGutterNextHunk call hunk#next_hunk(<count>)
command -count=1 GitGutterPrevHunk call hunk#prev_hunk(<count>)
command GitGutterStageHunk call gitgutter#stage_hunk()
command GitGutterRevertHunk call gitgutter#revert_hunk()
command GitGutterStageHunk call gitgutter#stage_hunk()
command GitGutterRevertHunk call gitgutter#revert_hunk()
command GitGutterPreviewHunk call gitgutter#preview_hunk()
" Returns the git-diff hunks for the file or an empty list if there
" aren't any hunks.
@@ -127,8 +128,9 @@ if g:gitgutter_map_keys
endif
nnoremap <silent> <Plug>GitGutterStageHunk :GitGutterStageHunk<CR>
nnoremap <silent> <Plug>GitGutterRevertHunk :GitGutterRevertHunk<CR>
nnoremap <silent> <Plug>GitGutterStageHunk :GitGutterStageHunk<CR>
nnoremap <silent> <Plug>GitGutterRevertHunk :GitGutterRevertHunk<CR>
nnoremap <silent> <Plug>GitGutterPreviewHunk :GitGutterPreviewHunk<CR>
if g:gitgutter_map_keys
if !hasmapto('<Plug>GitGutterStageHunk') && maparg('<Leader>hs', 'n') ==# ''
@@ -137,6 +139,9 @@ if g:gitgutter_map_keys
if !hasmapto('<Plug>GitGutterRevertHunk') && maparg('<Leader>hr', 'n') ==# ''
nmap <Leader>hr <Plug>GitGutterRevertHunk
endif
if !hasmapto('<Plug>GitGutterPreviewHunk') && maparg('<Leader>hp', 'n') ==# ''
nmap <Leader>hp <Plug>GitGutterPreviewHunk
endif
endif
" }}}