From 09f138e4a5f11d7b843a66adba5977cd7ad88956 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 26 Nov 2009 22:14:28 +0100 Subject: [Vim] thanks greg_th for this git-blame current line stuff --- vimrc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vimrc') 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 b :GitBlameCurrentLine + " n goto next empty reply-to paragraph " m opens an empty reply-paragraph at this line " d deletes everything until but the signature -- cgit v1.2.3