Skip to content

yankline/vim-gitblame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitblame

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).

GitBlame demo


Table of Contents

  1. Installation
  2. Usage
  3. Mappings
  4. License

Installation

vim-plug (Vim/Neovim)

Plug 'yankline/vim-gitblame'
" then in Vim: :PlugInstall

Vim 8 "packages" (no plugin manager)

mkdir -p ~/.vim/pack/plugins/start
git clone https://github.com/yankline/vim-gitblame ~/.vim/pack/plugins/start/vim-gitblame

Help tags (optional)

:helptags ~/.vim/pack/plugins/start/vim-gitblame/doc
" or simply:
:helptags ALL

Usage

The plugin provides two functions:

  • GitBlame() Opens a vertical window showing git blame for the current buffer. If the blame window is already open, calling it again closes the window.

  • GitShow() Opens a vertical window showing git show for the commit under the cursor. If the show window is already open, calling it again closes the window.


Mappings

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>

TODO

  • add formatting to the git show output
  • add better handling for wrapping
  • fix scrollbind unsetting

License

MIT License Copyright (c) 2025–present yankline

About

Plugin to show the git blame of a file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published