4 ms·
What are the main use cases of multiple cursors? It seemed like an interesting feature, and I'm curious why it would be considered essential.
by shalabhc 10y ago
What are the main use cases of multiple cursors? It seemed like an interesting feature, and I'm curious why it would be considered essential.
- wishinghand 10y agoIt's basically a visual regular expressions. So I'll caveat my original statement that if you don't know regex, you need it. I never learned regex because I came from a self-taught, web development oriented background. So if I need to replace all instances of a variable, then go to the end of the line they were on and type in a different variable name or add a semi-colin, that's what I use.
- TeMPOraL 10y agoI use them very often in Emacs instead of keyboard macros. They are useful whenever you have to perform the exact same operations in several places simultaneously visible on the screen[0]. By operations I mean both simple ones, like writing something, and more complex ones, like navigating/deleting whole words (of different length), etc. Mostly I use it for quick renaming of variables, string fixes, and some structural changes in code. -- [0] - multiple cursors, at least in Emacs, can work off-screen too, but I don't like not seeing what's going on when I do changes.
- NoGravitas 10y agoI also do this, though I use iedit-mode rather than multiple-cursor-mode. However, I do like to point out that it's really just eye-candy for stuff I was already able to do in emacs. Previously, I would have used either keyboard macros or query-replace-regexp to do the same things.
- TeMPOraL 10y agoI second it. I too used either keyboard macros or query-replace- commands before. Multiple cursors is just nicer for these particular things.
- euyyn 10y agoFor me it's mainly part of this sequence: Ctrl-F <search query> SelectAll <edit with multiple cursors> Do it all the time.
- heartbreak 10y agoI love the CTRL+CMD+G route as well. Use it constantly when refactoring.
- madeofpalk 10y agoLots of little things. Select a multiple lines of an object/hash/dict, break into multiple cursors, rewrite line (copying and pasting as needed, it works that out as well) to change to variable declarations, or to add a comma, or to... whatever.
- breck 10y agoI often use "multiple cursors" as vertical cursors, to indent or dedent a whole block of code 1 space at a time. Often useful for contexts when shift+tab/tab doesn't work.