Ⅰ. 插件描述
Run mocha specs from vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'geekjuice/vim-mocha-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'geekjuice/vim-mocha-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'geekjuice/vim-mocha-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/geekjuice/vim-mocha
Ⅳ. 文档说明
# vim-mocha
This is a lightweight Mocha runner for Vim. Extracted from
vim-spec
Based off of Attamusc/vim-mocha and
subsequently thoughtbot/vim-rspec.
Use both RSpec and Mocha? Take a look at vim-spec!
Installation
Using vundle:
Bundle 'geekjuice/vim-mocha'If using zsh on OS X it may be necessary to run move /etc/zshenv to /etc/zshrc.
Using pathogen
cd ~/.vim/bundle
git clone git://github.com/geekjuice/vim-spec.gitUsing vim-plug
Plug 'geekjuice/vim-mocha'Example of key mappings
__NOTE__: The mappings have changed and use the same mappings as vim-rspec and
vim-spec. If this is a big issue for you, open an issue and I'll re-add/add the
namespace.
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>Configuration
Like thoughtbot/vim-rspec, the
following variables can be overwritten for custom spec commands:
g:mocha_js_commandg:mocha_coffee_command
Examples:
let g:mocha_js_command = "!mocha --recursive --no-colors {spec}"
let g:mocha_coffee_command = "!mocha -b --compilers coffee:coffee-script{spec}"
" Using test runners
let g:mocha_coffee_command = "!cortado {spec}"Note: cortado is a sugar wrapper for a more complex mocha call.
Notes
- Allow configuration for
mochaoptions i.e.--recursive,--reporter dot - __BUG__: Last nearest test fails if below
itcall
Credits
License
mocha.vim is released under the MIT License.