Format C/C++ files, including header files using AStyle with one keystroke win+shift+f (windows) or cmd+shift+f (macOS).
Usage
- Open a file with extensions like
.c , .cpp , .h , .hpp , .cc , or .cxx .
- Press
win+shift+f (windows) or cmd+shift+f (macOS) to format the file.
Features
- Zero Configuration: Simply open a file and press
win+shift+f (windows) or cmd+shift+f (macOS) to format the file.
- Customizable Styles: Leverage Astyle's popular formatting styles, such as:
- Allman
- K&R
- GNU
- Whitesmith
- Header File Support: Handles
.h files as either C or C++.
- Use AStyle Command Line Arguments in the format:
pad-oper max-continuation-indent=120 style=google in settings for the extension. See Documentation
Requirements
Nothing needed. AStyle is bundled with the extension.
Installation
- Install the CppFormat extension from the Visual Studio Code marketplace and you're set!
Enjoy!
| |