vim-mocha-special-blend


Ⅰ. 插件描述

a vim plugin to run a single mocha test or module

Ⅱ. 基本信息

创建日期:  2014-05-31
使用用户:  1
Github星:  5
插件作者:  Toran Billups

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'toranb/vim-mocha-special-blend'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'toranb/vim-mocha-special-blend'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'toranb/vim-mocha-special-blend'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/toranb/vim-mocha-special-blend

Ⅳ. 文档说明

# vim-mocha-special-blend

Ever want to run a single mocha test or module without having to find/replace?

The Plugin In Action

javascript

Installation

Use your plugin manager of choice.

  • Pathogen

    • git clone https://github.com/toranb/vim-mocha-special-blend ~/.vim/bundle/vim-mocha-special-blend
  • Vundle

    • Add Plugin 'toranb/vim-mocha-special-blend' to .vimrc
    • Run :PluginInstall
  • NeoBundle

    • Add NeoBundle 'https://github.com/toranb/vim-mocha-special-blend' to .vimrc
    • Run :NeoBundleInstall
  • vim-plug

    • Add Plug 'https://github.com/toranb/vim-mocha-special-blend' to .vimrc
    • Run :PlugInstall

Requirements

You need a VIM version that was compiled with python support, which is typical
for most distributions on Linux/Mac. You can check this by running
vim --version | grep +python
if you get a hit you are in business.

This plugin will work with any build tool or test suite because the command it
runs is an argument you pass in at the end of the function you invoke (see below).

Usage

The plugin provides two commands:

    RunSingleMochaTest
    RunSingleMochaModule

All arguments can be tab-completed. Ensure that your cursor is within a
module or function as appropriate for the command being called.

For ease of usage you can map the above actions to a shortcut. For example,
if you wanted leader mappings you could set something like the following in
your vimrc:

    nmap <Leader>tm :call InvokeTestMethodByType()<CR>
    function! InvokeTestMethodByType()
        exe ':RunSingleMochaTest npm test'
    endfunction

    nmap <Leader>tc :call InvokeTestClassByType()<CR>
    function! InvokeTestClassByType()
        exe ':RunSingleMochaModule npm test'
    endfunction

Credits

Most of the code used to write this plugin was stolen from the great Jarrod Taylor

https://github.com/JarrodCTaylor/vim-qunit-special-blend

添加新评论