tveskag/nvim-blame-line

github github
git plugin
star 107
stars
alert-circle 1
open issues
users 5
subscribers
git-branch 5
forks
CREATED

2019-03-04

UPDATED

3 months ago

packer

require('packer').startup(function()
  use 'tveskag/nvim-blame-line'
end)

paq

require "paq" { 
  'tveskag/nvim-blame-line'
}

nvim-blame-line

A small plugin that uses neovims virtual text to print git blame info at the end of the current line.

Also supports showing blame below the current window, for normal vim users.

nvim-blame-line prints author, date and summary of the commit belonging to the line underneath the cursor. Just like a real IDE!

Installation

Use a plugin manager like vim-plug

Plug 'tveskag/nvim-blame-line'

Usage

Example gif

Commands

The plugin is exposed through these commands:

  • EnableBlameLine
  • DisableBlameLine
  • ToggleBlameLine
  • SingleBlameLine

Example mapping:

nnoremap <silent> <leader>b :ToggleBlameLine<CR>

Use autocmd to enable on startup:

autocmd BufEnter * EnableBlameLine

Options

" Show blame info below the statusline instead of using virtual text
let g:blameLineUseVirtualText = 0

" Specify the highlight group used for the virtual text ('Comment' by default)
let g:blameLineVirtualTextHighlight = 'Question'

" Change format of virtual text ('%s' by default)
let g:blameLineVirtualTextFormat = '/* %s */'

" Customize format for git blame (Default format: '%an | %ar | %s')
let g:blameLineGitFormat = '%an - %s'
" Refer to 'git-show --format=' man pages for format options)

" Change message when content is not committed
let g:blameLineMessageWhenNotYetCommited = ''