For anyone that doesn't know it, Multiple Cursors is the ONE BRILLIANT FEATURE that Sublime Text has. Don't get me wrong, tt's great in many other ways too, but Multiple Cursors is, IMO, a feature that should become part of every friggin' text editor in existence, it's that important. And it only exists in Sublime Text.
It gives you multiple cursors at seperate places in your document. Each one acts completely independently, moving around with your commands. Everything works as expected, including copy-pasting (it will match the copy-pastes up to your cursors).
Most text editors have a column-select mode, except that Multiple Cursors are the same thing on steroids:
1. The selections don't have to be contiguous. So if you have a bunch of:
<div>
<p> Text And more Text</p>
<p> Something </p>
</div>You can put the cursor only on the <p>s.
2. Since each cursor acts independently, you can do operations that you simply can't do in column mode. For example, place the cursor on each <p>, select to the end of that </p>, and delete the text. This is even if the contents of the </p> are completely different.
3. Multi Cursor gives the same power as macros, but: They're visual! You see all the changes you're making in realtime. Any long-time vim user has probably recorded a macro, tried playing it back, and discovered that it didn't work. Well, with Multi Cursors, you see the cursor and changes in real-time. Make a wrong command? Undo it instantly.
Want an example of another actual use case? I used to have a plugin for Sublime Text that let me split a selection into multiple selections, based on a character. So, let's say I had this code:
foo(int a, char b, char c)
I could select the paramater list, run my shortcut to split by ",", then I'd get a different selection on each paramater. Then, I could simply multi-select three lines below it inside the actual function, paste, and I've got this code:
foo(int a, char b, char c)
int a
char b
char c
A dead-simple editing task I do 300 times a day.Another example? Let's say I have two "if" blocks in the top of a function:
if (somecondition):
return
if (anothercondition): return
Now, let's say for a second that I just realized I don't want to return, I want to do some processing, then return. This happens a few times a day for me. I just multi-select both "if"s, hit enter, and add the code. If it's two functions and I need to use the function names, I can even go back, copy the function name, and paste it as part of the processing!!Phew. If it seems I'm a fanboy for Multiple Cursors, I totally am. It's a brilliant tool that only exists in Sublime Text. I've unfortunately gone back to Vim, and am too far in Vim's world to manage working in Sublime Text, which is why I miss multiple cursors so much!
But I AM working on a Vim plugin that gives Vim Multiple-Cursors. Been working on it for a while, but I think I'm getting near a more-or-less stable version. Hopefully, it will be released soon.
</way-too-long-rant>