vim-codefmt icon indicating copy to clipboard operation
vim-codefmt copied to clipboard

Order include directives alphabetically.

Open syml opened this issue 10 years ago • 3 comments

The google C++ style guide recommends to sort include directives alphabetically. https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Names_and_Order_of_Includes

It would be nice if codefmt's FormatCode could also do this.

syml avatar Jul 06 '15 22:07 syml

Having two partial formatters for C++ might mean people would want #44 so you could run this include sorting and clang-format on the same source code.

dbarnett avatar Jul 06 '15 22:07 dbarnett

Discussion with clang-format owners indicate they may be willing to implement this in clang format.

fowles avatar Jul 14 '15 03:07 fowles

Looks like clang has a sortIncludes option now. Does it sort includes how you want it automatically now, or would we need to explicitly configure something to enable it?

dbarnett avatar Aug 27 '19 04:08 dbarnett