SlickEdit Community
SlickEdit Product Discussion => SlickEdit® => Topic started by: rjpontefract on August 18, 2015, 08:07:55 PM
-
I have some code similar to the following except that it has many more lines:
struct pair pairs[] =
{
{ "value 1", 1 },
{ "value 100", 100 },
{ "value 25", 25 },
{ "value 3000", 3000 }
};
Is there a way to indent the second values in the initialiser so that they are all aligned as follows:
struct pair pairs[] =
{
{ "value 1", 1 },
{ "value 100", 100 },
{ "value 25", 25 },
{ "value 3000", 3000 }
};
I seem to recall using an editor in the past that had a "tab-relative" command that would indent the current position on a line to match the next non-space character on the previous line which would work nicely for this.
Any help would be appreciated.
-
I think you want: format-columns
-
Thanks for the suggestion, that really helped. I searched the help for "tab" and "indent" not format. That'll teach me.
-
There was also a macro I remember either in slickedit or a predecessor (the E series from IBM) that allowed a 'queuing' (?) (think that was in the macro name) characters after a selected character, etc.
an example would be if you told it to queue the text after a , and set it up so the , was to be queued a a particular column result would be when the , was seen in a line it would be aligned at column specified and with the rest of the text after that.
-
That sounds like it would be useful. Maybe I'll have to find some time to get my hands dirty with Slick-C. The command I was thinking of is "indent-relative" in Emacs.
-
found this prior discussion of the topic: https://community.slickedit.com/index.php/topic,8744.0.html
-
Thanks again, that's very helpful. Time to give Google Translate's Norwegian support a work out :-)
-
Wow ... format-column is a nice find.
The other command I use is "align-selection-left" but not quite as nice as format_column.