aligning text in vim according to whitespace using tabularize plugin
vim
Solution
You can use this command:
:'<,'>Tabularize /\S\+;$/l1
- `/\S\+;$/` pattern: make `a;`,`*pa;`...`*pc;` as column separators.
- `l1` flag: make every column `left` alignment and `one` space after it. (Not required here, because it's a default behavior)
Problem
I'm trying to align the following text in vim using tabularize: ``` typedef struct { int a; int *pa; float b; float *pb; double c; double *pc; } foo_t; ``` to this: ``` typedef struct { int a; int *pa; float b; float *pb; double c; /* notice there's only one space between 'double' and 'c' */ double *pc; } foo_t; ``` I tried using `:'<,'>Tab/.*\s` but it leaves two spaces between `double` and `c`. How can I do this?