I often encounter situations when editing text or code, where I want to insert a rectangle of spaces to align objects, but I do not know exactly how many spaces to insert.
For example, consider the following (very far-fetched) fragment:
void *var = (void *)typedVar; void *otherVar = voidStarOtherVar; int intVar = x*y; int intVar2 = y*z;
In C mode, by default, Mx align leads to this, which is better:
void *var = (void *)typedVar; void *otherVar = voidStarOtherVar; int intVar = x*y; int intVar2 = y*z;
However, suppose my desired alignment (for some reason) is as follows:
void *var = (void *)typedVar; void *otherVar = voidStarOtherVar; int intVar = x*y; int intVar2 = y*z;
The only way I know this is to use Mx string-rectangle in the bottom three lines and enter the exact number of spaces.
However, I do not want to count the number of characters in (void *) before entering spaces, so it would be nice to have an โinteractiveโ insertion of the rectangle string. For example, I am typing a space in this interactive mode, and I see that it is immediately reflected in the text. I enter another space and it is inserted. This way I can interactively align the text to the desired position.
Is there a built-in way to do this? Or, otherwise, can I somehow create this functionality?
source share