For the past few years, I've been using - and loving - the Sublime Text (ST3) editor. In fact, I find it so enjoyable, that I've never even looked at any of the new editors that seem to be gaining popularity. One of the Sublime Text features that I couldn't live without is the ability to use multiple cursors and mutate multiple selections at the same time. I know this isn't a proprietary feature of Sublime Text; but, I find that it gives me a massive productivity boost in my day-to-day software development. As such, I thought it would be fun to explore the multi-cursor / multi-selection features more in-depth.
Most of this post is codified in the above video; however, I will outline the key-commands that I am using in the video below:
CMD+SHIFT+L- Breaks a multi-line selection into multiple selections, one per line.
ESC- Goes from using multiple cursors back to one cursor.
ALT+Drag- Inserts a new cursor on each line that is touched during the drag operation.
CMD+Click- Inserts a new cursor at each click location.
CMD+U- Undoes a cursor or selection change.
CMD+SHIFT+U- Redoes a cursor or selection change.
CMD+Drag- Adds a new selection and cursor.
CMD+SHIFT+Drag- Removes a selection and cursor.
CMD+D- Adds the next match as an additional selection and cursor.
CMD+K,CMD+D- Removes the current match from the selection and adds the next match as an additional selection and cursor.
CTRL+CMD+G- Adds every match as a new selection and cursor.
CTRL+SHIFT+Up/Down- Adds a new cursor on the next/following line, respectively.
SHIFT+TAB- Indents and dedents a multi-line selection, respectively.
CMD+[- Indents and dedents each individual line that has a cursor.
Find All- This isn't a "key command"; but, the Find All feature will allow you to add a new selection and cursor to every matching piece of text. This is particularly powerful when combined with Regular Expressions.
Copy/Paste- Multiple selections can be copied and pasted at individual cursors.
Whether you use Sublime Text or some other editor, I cannot overemphasize the power of multiple cursors! It super-charges your productivity! I highly recommend you take the time to get comfortable with how your IDE implements this feature. And, if your IDE doesn't implement it, I suggest checking out Sublime Text - it's been my tried-and-true companion for years.