vimux-cargo


Ⅰ. 插件描述

Run cargo commands in vim

Ⅱ. 基本信息

创建日期:  2015-08-21
使用用户:  7
Github星:  9
插件作者:  John Downey

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vimux-cargo

Run cargo commands in vim and tmux using
vimux.

Usage

This plugin currently assumes you have a module named tests in the current
file and that modules are not nested.

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

map <Leader>rc :wa<CR> :CargoRun<CR>
map <Leader>ra :wa<CR> :CargoTestAll<CR>
map <Leader>rb :wa<CR> :CargoUnitTestCurrentFile<CR>
map <Leader>rf :wa<CR> :CargoUnitTestFocused<CR>

Commands

  • CargoRun - run the project, currently this assumes there is only one
    binary
  • CargoTestAll - run all tests
  • CargoUnitTestCurrentFile - run the whole test module in the current file
  • CargoUnitTestFocused - find the first test above your current line and run
  1. test

See Also

添加新评论