Ⅰ. 插件描述
Vim plugin for https://github.com/cweill/gotestsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'buoto/gotests-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'buoto/gotests-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'buoto/gotests-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/buoto/gotests-vim
Ⅳ. 文档说明
# gotests-vim
Vim plugin for gotests, that allows
you to generate table driven tests easily.
Usage
Call :GoTests to generate a test for the function at the current line or functions selected in visual mode.
Call :GoTestsAll to generate tests for all functions in the current buffer.
Installation
Gotests-vim requires gotests to be available in your $PATH. Alternatively you
can provide path to gotests using g:gotests_bin setting.
Plugin installation:
git clone https://github.com/buoto/gotests-vim.git ~/.vim/bundle/gotests-vim
Plug 'buoto/gotests-vim'
NeoBundle 'buoto/gotests-vim'
Plugin 'buoto/gotests-vim'
Vim packages (since Vim 7.4.1528)
git clone https://github.com/buoto/gotests-vim.git ~/.vim/pack/plugins/start/gotests-vim
Settings
If you want you can set path to your gotests binary if it's not in your path, for example:
let g:gotests_bin = '/home/user/go/bin/gotests'
You can also set custom template directory:
let g:gotests_template_dir = '/home/user/templates/'