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?
You can use this command:
/\S\+;$/pattern: makea;,*pa;…*pc;as column separators.l1flag: make every columnleftalignment andonespace after it. (Not required here, because it’s a default behavior)