https://github.com/casey/cargo-quickfix
Populate Vim quickfix files with Cargo messages
https://github.com/casey/cargo-quickfix
Last synced: over 1 year ago
JSON representation
Populate Vim quickfix files with Cargo messages
- Host: GitHub
- URL: https://github.com/casey/cargo-quickfix
- Owner: casey
- License: cc0-1.0
- Created: 2021-05-29T05:06:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-28T00:02:09.000Z (almost 4 years ago)
- Last Synced: 2025-03-18T15:49:08.529Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 33.2 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
# `cargo-quickfix`
`cargo-quickfix` is a `cargo` wrapper for use with Vim's [quickfix feature](http://vimdoc.sourceforge.net/htmldoc/quickfix.html).
The normal way to use the quickfix feature is to run build commands inside of Vim using `:make`, which automatically populates the quickfix buffer.
However, this can be inconvenient if you prefer to run `cargo` outside of Vim.
`cargo-quickfix` allows you to run `cargo` commands outside of `vim`, but still populate the quickfix list with error locations.
## Quick Start
- Install:
```
cargo install cargo-quickfix
```
- Run:
```
cargo quickfix test
```
- Open vim:
```
vim
```
- Open the error file and jump to the first error:
```
:cfile
```
- Jump to the next error:
```
:cn
```
## Usage
Run `cargo quickfix `, for example, `cargo quickfix test`.
You can also omit the command, in which case `cargo quickfix` will default to `check`.
Upon running, the output of the `cargo` command will be copied to `.errors.txt`.
Inside a Vim instance in the same directory, load `.errors.txt` into the quickfix buffer and jump to the first error, if any, with `:cfile`.
Useful commands include:
- `:cn` Go to the next error.
- `:cp` Go the previous error.
- `:cope` Open the quickfix list.
See `:help quickfix` for information.
Optionally, install the [vim-qf](https://github.com/romainl/vim-qf) plugin for additional mappings and functionality.
## Ignoring `.errors.txt`
To avoid committing `.errors.txt` or seeing it in `git diff` and `git status`, you can add it to your repositories `.gitignore`.
To avoid needing to do this for every repository, you can add it to a global ignore file:
```
git config --global core.excludesFile '~/.gitignore'
echo .errors.txt > ~/.gitignore
```