4 ms·
Come on now. The advantage of multiple cursors is instant feedback by cycling through the cursors and observing all the changes in real-time and by being able t
by mannigfaltig 9y ago
Come on now. The advantage of multiple cursors is instant feedback by cycling through the cursors and observing all the changes in real-time and by being able to undo changes and interactively adapt to the observed problems, without having to redefine the entire sequence of actions. Macros can achieve the same, but in many cases it just takes much more time.
- davexunit 9y agoRectangle editing commands in Emacs take care of 99% of the applications of multiple cursors. I have never had a use for them.
- yoodenvranx 9y agoRectangle editing does not cover 99% of my use cases for multiple cursors in Sublime Text.
- Veedrac 9y agoRectangle edits are equivalent to a tiny minority of what I use multiple cursors for (and are generally just rare overall), so this doesn't make much sense to me.
- mcherm 9y ago> Rectangle edits are equivalent to a tiny minority of what I use multiple cursors for Okay, now THAT is interesting. Can you comment on some of the other uses you have for multiple cursors? Perhaps give some examples?
- junke 9y agoFor all the things that are not aligned vertically in strictly consecutive lines. Suppose you wrote some silly code like this: (cond ((eq x :one) ...) ((eq x :two) ...) ((eq x :three) ...)) Replace "cond" by "case x". Select first "eq x", mark the other two (you have 3 cursors now), forward to the keywoard, M-<up> (with paredit): (case x (:one ...) (:two ...) (:three ...))
- Veedrac 9y agoAs an example, at the moment I'm juggling a large number of constants where I'm still learning how to classify and group them. I can use alt-d and alt-shift-d to select between local groups, either whole words or just suffixes, and rename them locally. A multiselection is normally, say, 3 to 10 selections of 3 to 10 characters, so the edits themselves are far too tiny and frequent for macros to meaningfully help, yet far too irregular for column selection to help. At the same time, multiple selections are acting as an incremental search and a way to jump between places. Frequently I do want to do regular operations, but columns are way too restrictive. Say I had something like the anonymized code Salad foo; foo.fred = chance(mulch, 4, 1); foo.fools = chance(mulch, 7, 4); foo.cheese = chance(mulch, 10, 7); Salad bar; bar.run = chance(mulch, 4, 1); bar.jump = chance(mulch, 7, 4); bar.fly = chance(mulch, 12, 7); Salad crouton; crouton.crunch = chance(mulch, 4, 1); crouton.splat = chance(mulch, 7, 4); crouton.swim = chance(mulch, 12, 7); and I wanted to subtract one from the middle argument to each call to `chance`. Column selections aren't impossible here, because there is some structure, but with multiple cursors I can just select all the relevant `chance`, ctrl-right to the end of the relevant number, write "-1", ctrl-shift-left so I select the expression, and press my evaluate key (ctrl-shift-e) to run the subtraction. Or say I have some Markdown and I want to give a correct-width underline to a title. ctrl-d to duplicate and select the new line, shift-left to unselect the newline character, alt-c to break the selection into characters, and then just press "=" to replace them all. Or say I want to reformat a function call so all the arguments are on new lines, I will naturally gravitate to selecting a separator (the comma in all likelihood) and just adding a newline there. I can keep some arguments together by just skipping those. This isn't to say multiple selections is the only way to do this stuff; this is just the way I like doing it with my editor.
- NoodleIncident 9y agoThe "all hat and no cattle" link in the OP is a much better argument for macros>multiple cursors: https://medium.com/@schtoeffel/you-don-t-need-more-than-one-cursor-in-vim-2c44117d51db https://medium.com/@schtoeffel/you-don-t-need-more-than-one-... Editors without vim macros probably need multiple cursors, but the main argument in favor of macros is that (for things like the markdown underline macro), it's easy to save it for later, and you can see it happen to every location even if some are offscreen.