A tiny Vim plugin that shows the git blame for the current buffer or the
git show for the commit under your cursor—each in a vertical window
(toggle behavior).
vim-plug (Vim/Neovim)
Plug 'yankline/vim-gitblame'
" then in Vim: :PlugInstallVim 8 "packages" (no plugin manager)
mkdir -p ~/.vim/pack/plugins/start
git clone https://github.com/yankline/vim-gitblame ~/.vim/pack/plugins/start/vim-gitblameHelp tags (optional)
:helptags ~/.vim/pack/plugins/start/vim-gitblame/doc
" or simply:
:helptags ALLThe plugin provides two functions:
-
GitBlame()Opens a vertical window showinggit blamefor the current buffer. If the blame window is already open, calling it again closes the window. -
GitShow()Opens a vertical window showinggit showfor the commit under the cursor. If the show window is already open, calling it again closes the window.
Map the functions to whatever keys you prefer. For example, in your ~/.vimrc:
" Vim-gitblame mappings
nnoremap <leader>b :call GitBlame()<CR>
nnoremap <leader>s :call GitShow()<CR>- add formatting to the git show output
- add better handling for wrapping
- fix scrollbind unsetting
MIT License Copyright (c) 2025–present yankline
