From 71a55df4e98199a3d17741f453e14babbac5d950 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 25 Aug 2020 09:42:16 +0200 Subject: [PATCH] Add SplitBlame vim command --- vim/plugin/git.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/vim/plugin/git.vim b/vim/plugin/git.vim index ab80bcc..c4e9a93 100644 --- a/vim/plugin/git.vim +++ b/vim/plugin/git.vim @@ -231,6 +231,25 @@ endfun au BufReadPost * try | let b:blame=git_blame("","") | catch | unlet! b:blame | endtry au BufWritePost * try | let b:blame=git_blame("","") | catch | unlet! b:blame | endtry +command! -nargs=? SplitBlame exec + \| exec 'normal m"gg' + \| set cursorbind scrollbind + \| vert bel split + \| exec 'Scratch blame' + \| set cursorbind scrollbind + \| exec 'r !git blame #' + \| 1delete 1 + \| silent %s/ *+.*$// + \| silent %s/(// + \| silent %s/^\(\x\{8}\) \(.*\)$/\2 \1/ + \| silent %s/^.*0\{8}$// + \| call matchadd('Comment', '\x\+$') + \| call matchadd('Comment', '\d\{4}-\d\{2}-\d\{2} \d\{2}:\d\{2}:\d\{2}') + \| call matchadd('Todo', ) + \| vertical resize 50 + \| exec "normal h" + \| exec 'normal `"' + command! -range -nargs=? Blame call blame_command(, , ) command! -range DBlame !git blame % -L , command! GitNext call git_next()