diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2009-11-26 22:14:28 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2009-11-26 22:14:28 +0100 |
commit | 09f138e4a5f11d7b843a66adba5977cd7ad88956 (patch) | |
tree | a3ebb39040224287eb9759d3ca264d256c25b069 /vimrc | |
parent | 4a1a012b244b088d4ec0c764a28eb9edd8830a99 (diff) |
[Vim] thanks greg_th for this git-blame current line stuff
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 |