Erlang Formatter for Visual Studio Code
Auto format on Save
1. Install the VSC extension
Install the Erlang Formatter from the Visual Studio Marketplace from this link or by searching from the Extensions tab within the app itself. If you have trouble finding it search for
2. Install Rebar
Follow the official Rebar install instructions or use the commands below which will download rebar3 to a temporary directory and install it for your OS user.
Then add rebar3 to your PATH by putting it to your shell configuration file (for example
3a. Default formatter setup
If you just want to get up and running quickly, run the following command for a good default. Otherwise read the section below for more detail.
NOTE: The first time you format your code it might take a few seconds if rebar3 hasn't already downloaded the formatter plugin.
3b. Choosing a specific formatter
There are three main options for Erlang formatters right now. They are all written in Erlang and depend on rebar3. There's no community consensus on which to use, so you'll just have to pick one. Simply add the plugin to your project's
4. Extension configuration
Add the extension config to your preferences file.
NOTE: If you want to use another formatter just replace
Thanks to the authors of these projects, which were highly valuable resources.
Visual Studio Code Extensions