commit f6e6b785823d7dd9ff0b80181fa4e23ace8d6662
parent 969fedae1d67265d9d65465ef23ba202820d7c84
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Fri, 7 Aug 2020 21:52:16 +0200
vim: one-line git blame mapping
Former-commit-id: 961422747bacd470c88360779a75c1437ad36a1e
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/vim/vimrc b/vim/vimrc
@@ -870,8 +870,12 @@ endif
" 'Zoom' the current buffer in a new tab
nnoremap <C-w>Z :tab split<CR>
+" Go to line:column
nnoremap <leader>gg :call input("go line:col> ")->split(":")->cursor()<CR>
+" Which commit introduced this line?
+nnoremap <silent><Leader>gb :call setbufvar(winbufnr(popup_atcursor(systemlist("cd " . shellescape(fnamemodify(resolve(expand('%:p')), ":h")) . " && git log --no-merges -n 1 -L " . shellescape(line("v") . "," . line(".") . ":" . resolve(expand("%:p")))), { "padding": [1,1,1,1], "pos": "botleft", "wrap": 0, "highlight": "StatusLine"})), "&filetype", "git")<CR>
+
" Avoid paste hijacking in insert mode
inoremap <c-r> <c-r><c-o>
" Autocommands {{{1