For quite a long time I use QtCreator as the main and only IDE. These are mainly C ++ projects. However, from the very beginning I was not satisfied with the auto-formatting of the code. The fact is that the code formatting common for C ++ does not suit me at all. Just a couple of days ago, I found on the network a description of the formatting method that I use, and call it "JavaStyle" there. Short example:
#include <iostream> #include <vector> #include <map> typedef std::vector<uint> PathType; typedef std::map<uint,bool> VisType; typedef std::map<uint,std::vector<uint>> RelType; void PrintPath(uint I, PathType P, VisType V, RelType &R) { if (V.find(I) != V.end()) return; P.push_back(I); V[I]=true; for(const auto& x: P) std::cout << ":" << x; std::cout << std::endl; for(const auto& i: R[I]) PrintPath(i,P,V,R); } int main() { VisType Vis; PathType Path; RelType Rel = { {0,{1,5,6}}, {1,{0,2,6}}, {2,{1,3,6}}, {3,{2,4,6}}, {4,{3,5,6}}, {5,{0,4,6}}, {6,{0,1,2,3,4,5}} }; for(auto const& i:Rel) PrintPath(i.first,Path,Vis,Rel); } For some time now, the inconvenience of auto-formatting as I need is beginning to get in the way. In the settings of QtCreator, I did not find the method I needed, there the curly brackets are set rigidly on the next line, only you can adjust the indents.
Questions:
- Is it possible to somehow customize / "train with plugins" QtCreator for the necessary auto formatting?
- Which other IDEs have similar QtCreator functionality and allow the auto formatting I need?