3 ms·
AFAICT multi-cursor mode is not nearly as useful as vim (or keyboard macros in most editors). I don't know SublimeText but I do know, functionality of multi-cur
by asiachick 5y ago
AFAICT multi-cursor mode is not nearly as useful as vim (or keyboard macros in most editors). I don't know SublimeText but I do know, functionality of multi-cursors is often limited. For example, say I want to go to all functions calls
foo(aa, bb, c);
foo(d, ggg, hh);
foo(iiii, i, jjjj);
I want to do something to the 2nd argument on each line. add a fn(prevContents). So I search for "foo(" and then pick "put a cursor on every match". Then how do get to the first comma and the select to the second comma on each line? This is easy with vim, easy with keyboard macros, not easy with multiple cursors (that I know of). For example as soon as I press "find" so I can search for the comma I lose multiple cursors. Maybe there's a special "Search with multiple cursors" command but if so that just highlights the issue, you shouldn't need special commands, you should be able to combine existing commands. vim and keyboard macros make that easy.
- dracyr 5y agoNow, I use vim mode in Sublime, so I have already "seen the light" so to say. But that situation is probably one I'd actually be able to solve faster with multiple cursors. What I'd do is this: Put the cursor on one of the calls, then use ctrl-d to put a new cursor at all the matches. Then use ctrl-right-arrow to move by word until the second comma, combine that with shift to select the argument and edit all of them with visual feedback to my heart's content. In reality, depending on the complexity of the text, after creating all the cursors, I'd probably use the vim movements to get them to where I need though.
- LegionMammal978 5y agoFor things like that, I usually make use of the C-Left and C-Right combinations to get to the same place on every line; after all, if two lines are similar enough for me to do the same thing to all of them, they very often have the same sequence of words. (Sometimes there can be issues, e.g., if one line has an extra index.) For reference, I tried your particular example, and the keystrokes look something like: C-f, "foo\(" [open a Find dialog] C-Enter: [foo(]XX, YY, ZZ); [Find All shortcut] Right: foo(|XX, YY, ZZ); [move to the right side of the match] C-Right: foo(XX|, YY, ZZ); C-Right: foo(XX,| YY, ZZ); C-Right: foo(XX, YY|, ZZ); C-S-Left: foo(XX, [YY], ZZ); [select leftward] I suppose that it's not quite as ergonomic as Vim keybindings, but it's definitely less of a departure from the usual OS text boxes.