aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/git-blamer
diff options
context:
space:
mode:
Diffstat (limited to 'bundle/git-blamer')
-rw-r--r--bundle/git-blamer/autoload/git_blamer.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/bundle/git-blamer/autoload/git_blamer.vim b/bundle/git-blamer/autoload/git_blamer.vim
index df9832e..8245986 100644
--- a/bundle/git-blamer/autoload/git_blamer.vim
+++ b/bundle/git-blamer/autoload/git_blamer.vim
@@ -41,6 +41,7 @@ function! git_blamer#Blame()
syncbind
nnoremap <buffer> q :q<CR>
+ nnoremap <buffer> <Enter> :call <SID>GitShow()<CR>
" Restore starting file's scrollbind on exit
autocmd BufWinLeave <buffer>
@@ -63,3 +64,12 @@ function! s:RemoveWindowFocusAutocmd()
autocmd!
augroup END
endfunction
+
+function! s:GitShow()
+ execute '!git show ' . s:CommitSHAFromLine('.')
+endfunction
+
+function! s:CommitSHAFromLine(line)
+ let current_line = getline(a:line)
+ return matchstr(current_line, '\v^[0-9a-f]+')
+endfunction