Alejandra 💅
The Uncompromising Nix Code Formatter
Features
This extension adds built-in editor support
for formatting Nix files automatically
with Alejandra.
Getting started
Make sure to install
Alejandra
in your system first
as explained here.
Install the vscode extension and reload the window (just close and open again).
Open a Nix file,
do a right click
and you should be able to see "Format Document" in the menu.
Alternatively, it will be formatted automatically when you save the file.
Enjoy!
Troubleshooting
If you encounter a problem
please let us know in the
issues section.
The most probable causes of failure are:
Not having Alejandra installed in your system.
In this case please follow the instructions
here.
A misconfiguration.
In this case please make sure that your config contains the following values:
{
"[nix]": {
"editor.defaultFormatter": "kamadorueda.alejandra",
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": false
},
"alejandra.program": "alejandra"
}
| |