4 ms·
>In fact, many of the people arguing against multi-cursors have been convinced after trying them that they are better. Fact by who? >The basic problem with ma
by Morgawr 12y ago
>In fact, many of the people arguing against multi-cursors have been convinced after trying them that they are better.
Fact by who?
>The basic problem with macros and global replace is that they don't happen immediately and don't give you feedback. I don't know any vim user who hasn't had the distinct pleasure of needing 3 tries to record a macro before they got it right.
True about macros, which are a very powerful tool that's way more than just multiple cursors. For global replace, however, this is false. Vim has an option to enable visual feedback for select/replace commands. I use it every day and it's awesome.
>What's more, if I record a macro and run it, then realize after it that I want to do a small addition, I have to go through all the "setup" steps again - go back to the start, re-record, add the logical of finding the next block, and so on. I can't just visually see the situation and say "oh yeah, why don't I add this little tweak".
What about recording the rest of the macro and running both of them one after the other?
>Seriously, take a very common example: having 3 if's one after the other, where you want to add a line at the start of each if block. Doing this with multiple cursors is a breeze - 3 buttons and you get 3 cursors, then write your code. And if, after writing it, you realize you actually want to add another line, you just keep typing. It's literally the same as typing.
v<linenum>j:s/if/<whatever>if/g
oh wait, I wanted to add another line?
uv<linenum>j:<up><change regex>
Also as somebody already pointed out, vim already has plugin(s) for multiple cursor support and they work exactly as they should.
I'm not arguing against multiple cursors, I'm just saying that they don't really bring anything new.
- bilalq 12y agoJust to add to that, you can also use visual block mode to change text on multiple lines. You get a lot of the benefits of multiple cursors that way while still doing things in a more traditional "vim-like" way.
- edanm 12y agoNo reason not to do things in a vim-like way with multiple cursors. In fact, they're literally just an extension of the block-mode concept, except that it's just better because it allows you to do a superset of things.
- icholy 12y agoThey don't bring anything new in the same way a repl doesn't bring anything new to a edit/compile/run cycle. Instant feedback is just better.
- edanm 12y ago>Fact by who? By me. I've talked to people and they've changed their minds. Sorry, should've made that explicit. >What about recording the rest of the macro and running both of them one after the other? Because sometimes you only think of it later. >Also as somebody already pointed out, vim already has plugin(s) for multiple cursor support and they work exactly as they should. I'm not arguing against multiple cursors, I'm just saying that they don't really bring anything new. As I mentioned to them, I used that plugin, and while it's awesome and I totally love the author for making it, it just isn't as good. See my other comment for details. And again, I really disagree that they don't bring anything new. That's like saying that WYSIWYG text editors don't bring everything new over systems like Latex. Can you do everything in both systems? Yes. Is it sometimes easier to just select text and hit "ctrl+b"? Yes. Is it always better? No. But it's good to have both options, as sometimes one crushes the other. Again, I love vim, and I definitely use some of the very methods you've mentioned. But I'm not here to sell you anything, I don't earn anything by convincing you to at least give multiple cursors a shot, except knowing that if you're dismissing them without having tried them then you're missing out and that makes me sad.