Search code examples
vimalignmenttabular

Aligning words without delimiters?


I'm trying to align words with vim-tabular, but without delimiters between them, like commas or colons. For instance:

int   x = 1;
float y = 2;
char  z = 3;

What expression do I need to use to align text like that?


Solution

  • Align on the first word

    :Tabularize/^\s*\w\+/
    

    For more help see: :h tabular.