Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jtdowney/vimux-cargo

Run cargo commands in vim
https://github.com/jtdowney/vimux-cargo

Last synced: about 1 month ago
JSON representation

Run cargo commands in vim

Awesome Lists containing this project

README

        

# vimux-cargo

[![Vint](https://github.com/jtdowney/vimux-cargo/workflows/Vint/badge.svg)](https://github.com/jtdowney/vimux-cargo/actions?workflow=Vint)

Run [cargo](https://github.com/rust-lang/cargo) commands in vim and tmux using
[vimux](https://github.com/preservim/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.

```vim
map rc :wa :CargoRun
map ra :wa :CargoTestAll
map rb :wa :CargoUnitTestCurrentFile
map rf :wa :CargoUnitTestFocused
```

### 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
that test

## See Also

* [The Rust Programming Language: Testing](https://doc.rust-lang.org/stable/book/testing.html)