summaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc11
1 files changed, 11 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 4d7e781..e60c103 100644
--- a/vimrc
+++ b/vimrc
@@ -164,6 +164,17 @@ function! Erase_Sig_but_Your()
endif
endfunction
+function! GitBlameCurrentLine()
+ let l:line = line('.')
+ let l:file = expand("%:t")
+ let l:wd = expand("%:p:h")
+ let content = system("cd " . l:wd . ";git blame -L ". l:line . "," . l:line . " " . l:file . " | sed 's/).*/)/'")
+ let line = split(content, '\n')[0]
+ echohl Type | echo line | echohl None
+endfunction
+command! GitBlameCurrentLine :call GitBlameCurrentLine()
+map <ESC>b :GitBlameCurrentLine<CR>
+
" <ESC>n goto next empty reply-to paragraph
" <ESC>m opens an empty reply-paragraph at this line
" <ESC>d deletes everything until but the signature