4 ms·
Any time you need to make the same edits in multiple places. I use it to mass edit array items for example by using the highlight / add cursor to identical text
by rezonant 3y ago
Any time you need to make the same edits in multiple places. I use it to mass edit array items for example by using the highlight / add cursor to identical text feature in VS Code (Ctrl+D). I even use it to copy data out of the browser and mass edit it into data structures-- often there will be some pattern to the pasted data even if it's garbage, so being able to quickly set up multicursors around the patterns in the text makes this sort of task much easier, if you are luckily on how the data pastes out.
Multicursors are the number one editor innovation of the last ten years that developers should get comfortable with-- once you start to use them you won't want to use an editor without them.
- innocenat 3y agoPersonally while there are some task that's easier with multiple cursors, I have personally yet to find any use case where regexp replace in selections doesn't work as well.
- germandiago 3y agoI find Emacs Macros and rectangular editing as more useful in lore situations than multiple cursors. As for regexps, the syntax in Emacs is hell, but I do know Emcacs has very powerful edit/replace tools.
- cylinder714 3y ago"Emcacs"...I like it.
- germandiago 3y agoYeah... typing fast and from the phone has this problem
- overtomanu 3y agoMulti-cursor is more flexible than rectangular selection. You can skip or delete words of varying length etc. It is certainly less powerful than vim macro and regex, but it's easy to use because 1) there are less shortcuts to remember 2) no need to think too much like figuring out regex for simple tasks 3) it gives instant feedback Video showing this https://youtu.be/lhFNWTAIzOI?t=28 https://youtu.be/lhFNWTAIzOI?t=28
- siproprio 3y agoskill issue tbh
- edflsafoiewq 3y agoThere's a reason people use visual editors and not ed.
- treflop 3y agoWouldn’t remotely compare regex to ed. I also haven’t found a use for multiple cursors. Writing a regex is quick and easy.
- madacol 3y agoYou cannot edit in real-time with regex With regex, you need to plan everything you need to do and then surgically do it. With multiple cursors, you only need to know (roughly) where you need to change, the rest you figure it out on the fly.
- lf-non 3y agoIn editors like vim/emacs it is possible and common.
- lenkite 3y agoI guess with rectangular selection and macros, VIM folks don't find much use for multiple cursors.