项目作者: tveskag

项目描述 :
A small plugin that uses neovims virtual text to print git blame info at the end of the current line.
高级语言: Vim script
项目地址: git://github.com/tveskag/nvim-blame-line.git
创建时间: 2019-03-04T23:09:26Z
项目社区:https://github.com/tveskag/nvim-blame-line

开源协议:MIT License

下载


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

  1. Plug 'tveskag/nvim-blame-line'

Usage

Example gif

Commands

The plugin is exposed through these commands:

  • EnableBlameLine
  • DisableBlameLine
  • ToggleBlameLine
  • SingleBlameLine

Example mapping:

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

Use autocmd to enable on startup:

  1. autocmd BufEnter * EnableBlameLine

Options

  1. " Show blame info below the statusline instead of using virtual text
  2. let g:blameLineUseVirtualText = 0
  3. " Specify the highlight group used for the virtual text ('Comment' by default)
  4. let g:blameLineVirtualTextHighlight = 'Question'
  5. " Change format of virtual text ('%s' by default)
  6. let g:blameLineVirtualTextFormat = '/* %s */'
  7. " Customize format for git blame (Default format: '%an | %ar | %s')
  8. let g:blameLineGitFormat = '%an - %s'
  9. " Refer to 'git-show --format=' man pages for format options)
  10. " Change message when content is not committed
  11. let g:blameLineMessageWhenNotYetCommited = ''