Ⅰ. 插件描述
extracted and extended vim plugin for gem https://github.com/nyarly/cadre/Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'killphi/vim-legend'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'killphi/vim-legend'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'killphi/vim-legend'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/killphi/vim-legend
Ⅳ. 文档说明
<!-- vim: set ft=markdown fo+=aw : Hurray for working on a Vim project -->
Vim-Legend
This plugin parses coverage files and creates signs in the left gutter to
indicate which lines have been hit/missed/ignored.
Currently, vim-legend parses the output of a Ruby gem called
cadre, but the
intention is to expand the possible coverage files to different coverage
systems and languages.
Once it's installed, it will detect coverage files whenever you enter a buffer.
You'll see signs on the left of the file indicating what's been tested and
what's not. Most of the time, they're easy to ignore and when you need to know
what code has been covered and what's not, it's super handy.
Oh, a screenshot:
| Vim with Legend | Simplecov HTML output |
|---|---|
![]() | ![]() |
Installation
You should be able to use your preferred Vim package manager. I for one like Vundle:
Add this to your .vimrc:
Bundle 'killphi/vim-legend'And then:
:BundleWhy "legend" ?
In spy jargon, a "legend" is the cover story constructed by and agency for its
- So it's a kind of a play on words, you see. A legend is also the
- of symbols on a map to describe what they mean. So, it's a tool to guide
and protect you while you code.
Adapters
The actual format vim-legend uses is just a Vim script, and pretty simple at that.
It's possible to write programs to convert the output of other coverage tools
into the vim-legend format.
In fact, there's already a program to do this for Go:
https://github.com/nyarly/legendary

