Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alx741/vim-rustfmt
Vim Rust rustfmt integration plugin
https://github.com/alx741/vim-rustfmt
rust rustfmt vim
Last synced: 21 days ago
JSON representation
Vim Rust rustfmt integration plugin
- Host: GitHub
- URL: https://github.com/alx741/vim-rustfmt
- Owner: alx741
- Created: 2019-01-14T00:45:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-26T21:31:49.000Z (almost 3 years ago)
- Last Synced: 2024-10-11T23:59:16.074Z (about 1 month ago)
- Topics: rust, rustfmt, vim
- Language: Vim script
- Size: 3.91 KB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-rustfmt
Integrates with [rustfmt](https://github.com/rust-lang/rustfmt) so every time
you save a Rust source file it gets automatically prettified.Simply using `:%!rustfmt` replaces your whole source file with an error message
from **rustfmt** when you happen to have a syntax error in your code, this
plugin manages that annoyance.## Installation
Compatible with `Vundle`, `Pathogen`, `Vim-plug`, etc.
## Usage
By default, *vim-rustfmt* will format your code automatically when saving a
Rust source file, but you can use the `:Rustfmt` command at any time to
format the current file.To apply *rustfmt* on a range, either write the range manually or visually
select the desired code and then invoke `:Rustfmt`.Use `:RustfmtEnable`, `:RustfmtDisable`, `:RustfmtToggle` to enable, disable, or
toggle running `rustfmt` on save.## Configuration
Trigger *rustfmt* when saving (default = 1):
```vim
g:rustfmt_on_save = 1
```Rust edition to use (default = '2021'):
```vim
g:rustfmt_edition = '2018'
```Backup modified files (default = 0):
```vim
g:rustfmt_backup = 0
```