- Install the Uncrustify extension in VS Code.
- Install the Uncrustify binary on your machine.
- Open VS Code settings (Code -> Preferences -> Settings).
- Search for "uncrustify.path" and set the path to the uncrustify binary.
- Search for "editor.formatOnSave" and enable it.
- Search for "editor.defaultFormatter" and set it to "uncrustify".
- Save the settings file.
After completing these steps, your code will be automatically formatted with Uncrustify when you save the file.