Select vertical column, uneven word endings

private int custid = -1;
private string partnumber = "";
private string description = "";

When editing source code, Is it possible to do a sort of SHIFT + ALT + LEFT CLICK, such that the vertical selection happens across all second spaces in a series of lines?  I don't think VS 2017 Community supports macro recording?  Or Visual Studio, period ... not for many years now, right?

For example, for the first line of code above, imagine the text cursor is blinking **just** after the " t " in "int".  This is the end of the second word on that line, or said another way, it is just before the second space.

To select the same spot for the second and third lines would select just after the " g " in the word "string" on those lines.

Then a few tabs would result in the following:

private int                               custid = -1;
private string                          partnumber = "";
private string                          description = "";

Then I could go back to the beginning of that THIRD column, do a normal SHIFT + ALT + LEFT CLICK from the " c " in custid down to the " d " in description, and add a character (say, an underscore) at the beginning of all of those variable names, like so:

private int                               _custid = -1;
private string                          _partnumber = "";
private string                          _description = "";


Open to a RegEx solution for my search and replace, but preference is some sort of keyboard command.

NOTE:  I found "Tabify" under the Edit - Advanced menu ----- it does not seem to work at all?  It seems to be what I want, but not available in C# text editor?
Tom KnowltonWeb developerAsked:
Who is Participating?
Shaun VermaakTechnical Specialist/DeveloperCommented:
Tabify replaces four spaces with a Tab.

You can try shortcut CTRL+ALT+] with ProductivityPowerTools installed
Tom KnowltonWeb developerAuthor Commented:
I wish I could give you 500,000 points.  This was precisely what I needed.

Many many thanks!

Tom KnowltonWeb developerAuthor Commented:
Oh, and thank you for the clarification on "Tabify" - noted!!!!

Shaun VermaakTechnical Specialist/DeveloperCommented:
Anytime, glad it solved it :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.