Categories: Code Editing | User Experience

Delimited column selection

It recently occurred to me that column selection is nice, but it could be awesome.

Here is what I mean by column selection:

Regular column selection

In most GUI editors, you perform this type of selection by alt-dragging the mouse down and to the right.

If all you wanted to do was add virtual after each public, this would be very useful.

But what if you wanted to strip away public plus the data type? For this, you would want the selection to go word-by-word instead of character-by-character as you alt-drag the mouse to the right.

To illustrate this concept, I created an animated GIF. (In case your curious how, I used PowerPoint to create the slides, saved them as PNG, imported them as layers into Paint .NET, and saved out the image as an AGIF using the Animated Image plugin.)

Delimited column selection - animated

I see this feature being useful for any situation where you have a bunch of similar declarations and you want to strip away something from each line or insert something new between the same two words of each line.

While writing this post, I began to wonder if delimited column selection already exists. I was thinking Sublime Text might have it, but I wasn't able to find it during my brief test drive. The default Visual Studio editors don't seem to have anything beyond standard column selection, but I did come across the MultiEditing extension, which Scott Hanselman blogged about in 2013. While it sounds quite useful (I think I'll install it), it wouldn't be quite as easy for the use cases I have in mind.

Anyway, if you'd like to see delimited column selection in Visual Studio, I just posted the idea to Visual Studio User Voice.

comments powered by Disqus