Search code examples
c++astyle

How to reduce redundant spaces between keywords in C++ code using astyle


I always type more spaces between keywords, or between identifiers without awareness. How can I configure astyle configuration file to reduce them to only one space automatically? For example:

int       main(int argc, const    char *argv[]) {
    int x    = 4;
    return 0;
}

Would become:

int main(int argc, const char *argv[]) {
    int x = 4;
    return 0;
}

Solution

  • Consider using clang-format in-place of astyle.