Skip to content

Commit a436945

Browse files
authored
Merge pull request #172 from nokaa/master
Add info to enable rustfmt
2 parents 19e6f60 + 7f7b2ac commit a436945

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
`rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs
55
enjoyable. `rust-mode` requires Emacs 24 or later.
66

7+
## Installation
8+
79
### Manual Installation
810

911
To install manually, check out this repository and add this to your
@@ -74,6 +76,18 @@ The file `rust-mode-tests.el` contains tests that can be run via
7476
You can use `run_rust_emacs_tests.sh` to run them in batch mode, if
7577
you set the environment variable EMACS to a program that runs emacs.
7678

79+
## Features
80+
81+
### Formatting with [rustfmt][rfmt]
82+
83+
The `rust-format-buffer` function will format your code with
84+
[rustfmt][rfmt] if installed. By default, this is bound to `C-c C-f`.
85+
86+
Placing `(setq rust-format-on-save t)` in your `~/.emacs` will enable automatic
87+
running of `rust-format-buffer` when you save a buffer.
88+
89+
[rfmt]: https://crates.io/crates/rustfmt/
90+
7791
## License
7892

7993
`rust-mode` is distributed under the terms of both the MIT license and the

0 commit comments

Comments
 (0)