Tabular.vim : how to align on the first occurrence of 2 different delimiters placed at the beginning of Words?

Posted by ThG on Stack Overflow See other posts from Stack Overflow or by ThG
Published on 2012-11-11T10:56:42Z Indexed on 2012/11/11 10:59 UTC
Read the original article Hit count: 154

Filed under:
|

I have installed the Tabular plugin, which works very well for me, as long as there are no complicated regexes involved…

But I have this list :

one @abc @rstuvw &foo  
three @defg &bar 
four @mn @opq &kludge &hack  
twelve @hijkl &baz &quux

I wish to align it that way (on @… first, then on &…) :

one    @abc @rstuvw &foo  
three  @defg        &bar 
four   @mn @opq     &kludge &hack  
twelve @hijkl       &baz &quux

which means I have 3 problems at the same time :

  • align on the first occurrence
  • of 2 different delimiters (@ and &)
  • which are not really delimiters but "special characters" at the beginning of Words

This is far beyond my understanding of both regexes and Tabular.vim

How should I proceed ?

© Stack Overflow or respective owner

Related posts about vim

Related posts about tabular