0

Bring back splitSelection

Thaddeus Selden 5 years ago • updated 5 years ago 2

Sublime Text 1 apparently had a splitSelection command that's not available in Sublime Text 2. It would be really nice to be able to highlight something, then with keyboard shortcut have multiple cursors on either side of what you had selected. 

Out of curiosity, when would you use that? The only thing I can think of is to surround the selection with quotes, and SublimeText 2 already handles that by letting you just type the quote character. It works with paired characters as well, i.e. parentheses and brackets.

Two common usecases for me:


1. Adding additional whitespace for readability. Similar to what you do with quotes or parens, but with spaces instead.


2. Wanting to do multi-line editing from the keyboard but without selecting lines in the middle. This is most common if I need to make changes to repeated sections in HTML or something like that. If I had this feature, I could just create a selection using the keyboard starting at the first spot I need the cursor and ending at the second, split the selection, and have two cursors. 


My only alternative in that case is to use the mouse, which for me breaks context. Split into lines adds the intermediate lines too which is often not what I want.