bind 'gb' to git-blaming the current line

This commit is contained in:
anon 2024-11-20 09:57:22 +01:00
parent 801ab467d6
commit 175459afcd

View File

@ -184,6 +184,13 @@
:%s/static /static\n/
endfunction
function! GitBlame()
let l:filename = expand('%')
let l:line_number = line('.')
execute 'silent !git blame -L ' . l:line_number . ',' . l:line_number . ' ' . l:filename
redraw!
endfunction
" --------------
" ### REMAPS ###
" --------------
@ -233,6 +240,9 @@
" Tagbar_plugin:
nmap <C-W>m :TagbarToggle<CR>
" Misc:
nnoremap gb :call GitBlame()<CR>
"------------------
" ### VARIABLES ###
"------------------