Search code examples
clang-format

I've a c++ vector, which is initialized in code. The clang format formats it into columns and rows, like a table


The clang format formats my file like this:

  std::vector<std::string> keys{"aaaaaaaaaa", "bbbbbbbbbbbb",     "cccccccccccc",         "ddddddddd",
                                "eeeeeeee",   "fffffffffff",      "ggggggggggg",          "hhhhhhhhhh",
                                "iiii",       "jjjjjjjjjjjjjjjj", "kkkkkkkkkkkkkkkkkkkkk"};

I'd like to format it like this:

  std::vector<std::string> keys{"aaaaaaaaaa",
                                "bbbbbbbbbbbb",
                                "cccccccccccc",
                                "ddddddddd",
                                "eeeeeeee",
                                "fffffffffff",
                                "ggggggggggg",
                                "hhhhhhhhhh",
                                "iiii",
                                "jjjjjjjjjjjjjjjj",
                                "kkkkkkkkkkkkkkkkkkkkk"};

How can I do it with clang-format?


Solution

  • I've solved it with BinPackArguments: false