Does anyone have or know about vim plugin/macro/function that indents nicely c++ templates?
When I highlight template definition in vim .hpp/.h file and indent it with '=' I get something like this:
> template <
> class TFilter,
> class TParser,
> class TConsumer,
> class TDataProcessor,
> class TDataFeed,
> class TSymbolMap
> >
> struct DataFeedTraits
> {
> typedef TFilter Filter;
> typedef TParser<TSymbolMap> Parser;
> typedef TConsumer<Parser> Consumer;
> typedef TDataProcessor<Filter,Consumer> DataProcessor;
> typedef TDataFeed<Filter,DataProcessor,Parser,Ccnsumer> DataFeed;
> };
I think the cindent aligns the struct/class declaration with the closing bracket '>'. I would like to end up with something like this, or similar, exact formatting does not matter, as far as it is formatted:
template <
class TFilter,
class TParser,
class TConsumer,
class TDataProcessor,
class TDataFeed,
class TSymbolMap
>
struct DataFeedTraits
{
typedef TFilter Filter;
typedef TParser<TSymbolMap> Parser;
typedef TConsumer<Parser> Consumer;
typedef TDataProcessor<Filter,Consumer> DataProcessor;
typedef TDataFeed<Filter,DataProcessor,Parser,Ccnsumer> DataFeed;
};