nvim-blame-line


Ⅰ. 插件描述

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

Ⅱ. 基本信息

创建日期:  2019-03-04
使用用户:  8
Github星:  46
插件作者:  Asger Viggo Korreman

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tveskag/nvim-blame-line'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tveskag/nvim-blame-line'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tveskag/nvim-blame-line'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/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'

" Add a prefix to the virtual text (empty by default)
let g:blameLineVirtualTextPrefix = '// '

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

添加新评论