Ⅰ. 插件描述
RSpec inside VIM with :makeⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'pablobender/vim-mrspec'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'pablobender/vim-mrspec'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'pablobender/vim-mrspec'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/pablobender/vim-mrspec
Ⅳ. 文档说明
# MRSpec
A simple Vim plugin to execute RSpec through :make command.
Motivation
Run rspec inside Vim and ouptut of failing specs into quickfix window (:cwindow). Also be able to run the spec/context/describe where the cursor is.
Features/Usage
To run the nearest spec/context/describe where the cursor is.
:MRSpecLineTo run specs for the current spec file.
:MRSpecFileTo run all specs.
:MRSpecAllTo re-execute the last spec location (line, file or all). It can be called out of a spec file. Useful when you fix a failing spec in production source file.
:MRSpecTips
If you think the commands too long or would like another commands, just put something like below into your ~/.vimrc file.
command RL call mrspec#RunLine()
command RF call mrspec#RunFile()
command RA call mrspec#RunAll()
command R call mrspec#Run()Now you can simple execute :RL, :RF, RA and :R to run each function, respectively.
Installation
You may install as you prefer. I like Vundle.
Put it into your Vundle configuration:
Bundle "pablobender/vim-mrspec.git"If you use pathogen as plugin manager, just unpack or clone the repository in your ~/.vim/bundle dir (creating a subfoler, eg: ~/.vim/bundle/vim-mrspec).
But if you don't use a plugin manager, you can download the source code and put it into your ~/.vim. Make sure to put the contents of vim-mrspec folder into your ~/.vim, not create a new vim-mrspec under it.
Requirements
MRSpec is a pure vimscript plugin, but only make sense if you are working on ruby/rspec project. So you need be able to run rspec on your terminal for your project.
License
MIT