Ⅰ. 插件描述
Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'alpaca-tc/neorspec-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'alpaca-tc/neorspec-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'alpaca-tc/neorspec-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/alpaca-tc/neorspec.vim
Ⅳ. 文档说明
# neorspec.vim
This is a Rspec runner for Vim.
Install
NeoBundleLazy 'alpaca-tc/neorspec.vim', {
\ 'depends' : 'tpope/vim-rails',
\ 'autoload' : {
\ 'commands' : [
\ 'RSpecAll', 'RSpecNearest', 'RSpecRetry',
\ 'RSpecCurrent', 'RSpec'
\ ] }}
NeoBundleLazy 'tpope/vim-dispatch', { 'autoload' : {
\ 'commands' : ['Dispatch', 'FocusDispatch', 'Start']
\ }}Commands
:RSpecAll:RSpecNearest:RSpecRetry:RSpecCurrent:RSpec
Example
function! s:load_rspec_settings()
nnoremap <buffer>,cr :<C-U>RSpecCurrent<CR>
nnoremap <buffer>,nr :<C-U>RSpecNearest<CR>
nnoremap <buffer>,lr :<C-U>RSpecRetry<CR>
nnoremap <buffer>,ar :<C-U>RSpecAll<CR>
nnoremap <buffer>,r :<C-U>RSpec<Space>
endfunction
augroup RSpecSetting
autoload!
autoload BufEnter *.rb call s:load_rspec_settings()
augroup ENDVariables
Overwrite g:neorspec_command variable to execute a custom command.
Example:
let g:neorspec_command = "!rspec --drb {spec}"let g:neorspec_command = "Dispatch zeus rspec {spec}"