vimux-golang


Ⅰ. 插件描述

Run golang tests using vimux

Ⅱ. 基本信息

创建日期:  2013-01-16
使用用户:  31
Github星:  25
插件作者:  Ben Mills

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'benmills/vimux-golang'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'benmills/vimux-golang'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'benmills/vimux-golang'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/benmills/vimux-golang

Ⅳ. 文档说明

# vimux-golang

Run golang tests in vim.

Usage

Add this to your .vimrc or inside .vim/ftplugin/go.vim if you want only use this mapping with files that have the go filetype.

map <Leader>ra :wa<CR> :GolangTestCurrentPackage<CR>
map <Leader>rf :wa<CR> :GolangTestFocused<CR>

GolangTestFocused will find the first func above your current line that starts with Test and run that with go test -run <test name>. If you're using examples this plugin will use -examples.run rather than -run.

This plugin assumes you will be testing the local package. For example if you run GolangTestCurrentPackage the resulting command would be: go test -v ..

Installation

With vim-bundle: vim-bundle install benmills/vimux-golang

Otherwise download the latest tarball, extract it and move plugin/vimux-golang.vim inside ~/.vim/plugin. If you're using pathogen, then move the entire folder extracted from the tarball into ~/.vim/bundle.

添加新评论