2015-11-13 10:49:06 +13:00
# Running Rustfmt from Atom
2018-05-29 09:04:56 +01:00
## RLS
Rustfmt is included with the Rust Language Server, itself provided by [ide-rust ](https://atom.io/packages/ide-rust ).
`apm install ide-rust`
Once installed a file is formatted with `ctrl-shift-c` or `cmd-shift-c` , also available in context menu.
## atom-beautify
Another way is to install [Beautify ](https://atom.io/packages/atom-beautify ), you
2015-11-13 10:49:06 +13:00
can do this by running `apm install atom-beautify` .
2015-11-17 10:52:05 +05:30
There are 2 setting that need to be configured in the atom beautifier configuration.
2015-11-13 10:49:06 +13:00
2015-11-17 10:52:05 +05:30
- Install rustfmt as per the [readme ](README.md ).
- Open the atom beautifier settings
2015-11-13 10:49:06 +13:00
2015-11-17 10:52:05 +05:30
Go to Edit->Preferences. Click the packages on the left side and click on setting for atom-beautifier
2015-11-13 10:49:06 +13:00
2015-11-17 10:52:05 +05:30
- Set rustfmt as the beautifier
2015-11-13 10:49:06 +13:00
2015-11-17 10:52:05 +05:30
Find the setting labeled *Language Config - Rust - Default Beautifier* and make sure it is set to rustfmt as shown below. You can also set the beautifier to auto format on save here.

- Set the path to your rustfmt location
Find the setting labeled *Rust - Rustfmt Path* . This setting is towards the bottom and you will need to scroll a bit. Set it to the path for your rustfmt executable.
