Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhinz/vim-crates
Handle Cargo dependencies like a Rustavimean.
https://github.com/mhinz/vim-crates
cargo crates-io neovim plugin rust vim
Last synced: 3 months ago
JSON representation
Handle Cargo dependencies like a Rustavimean.
- Host: GitHub
- URL: https://github.com/mhinz/vim-crates
- Owner: mhinz
- License: mit
- Created: 2019-11-02T19:47:22.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T13:11:19.000Z (about 2 years ago)
- Last Synced: 2024-08-07T18:46:38.702Z (6 months ago)
- Topics: cargo, crates-io, neovim, plugin, rust, vim
- Language: Vim script
- Homepage:
- Size: 1.06 MB
- Stars: 90
- Watchers: 5
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-crates
When maintaining Rust projects, this plugin helps with updating the dependencies
in `Cargo.toml` files. It uses the [crates.io](https://crates.io) API to get all
available versions of a crate and caches them._[curl](https://curl.haxx.se) needs to be installed._
- **Insert completion**
If the cursor is on a [version requirement](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies)
and in insert mode, use `` (hold Ctrl and hit
x then u) to open a completion menu with all available
versions (see `:h i_CTRL-X_CTRL-U`).- **:CratesUp**
Update the current dependency to the latest non-prerelease version.
- **:CratesToggle**
For each dependency that is out-of-date, indicate the latest version as virtual
text after the end of the line. Use it again to remove all indicators. This is
a [Nvim](https://github.com/neovim/neovim/)-only feature.Customize the colors of the indicators like this:
```vim
highlight Crates ctermfg=green ctermbg=NONE cterm=NONE
" or link it to another highlight group
highlight link Crates WarningMsg
```
Use `:verb CratesToggle` to see debug messages.Inspired by [serayuzgur/crates](https://github.com/serayuzgur/crates).
Happy 🦀 everyone!
## Configuration
Automatically run `:CratesToggle` when opening a `Cargo.toml` file:
```vim
if has('nvim')
autocmd BufRead Cargo.toml call crates#toggle()
endif
```## Demo
![](https://raw.githubusercontent.com/mhinz/vim-crates/master/demo.gif)