Re: Help with AlignMaps
- Gerald Lai wrote:nip]
>What! You should!!! :)
> I am unfamiliar with AlignMaps,
> but what you describe sounds like itThe problem here is not all "="s are equal! In other words, probably
> could be done with simple substitutions.
> Original: pointer stars before the variable name
> :%s/\w\zs\s\*\ze\h/* /g
> (the above is the basic idea, below is a more general form)
> Original: one space before and after the equal sign
> :%s/\w\zs\s=\s\ze\h/ = /g
> (the above is the basic idea, below is a more general form, allowing for
> any amount of space before and after the equal sign, enforcing the
> :%s/\w\zs\s*=\s*\ze\h/ = /g
the "="s inside comments should not be affected. Furthermore, it
doesn't avoid single-line comments (which could be done with a "v/.../"
as done in my own reply). Similar comments apply to the "*' handling
(besides, there may be more than one; ie; int **x; ).