Hacker News new | ask | show | jobs
by innocenat 816 days ago
Personally 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.
3 comments

You 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.

In editors like vim/emacs it is possible and common.
I 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.

Multi-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

skill issue tbh
"Emcacs"...I like it.
Yeah... typing fast and from the phone has this problem
There's a reason people use visual editors and not ed.
Wouldn’t remotely compare regex to ed.

I also haven’t found a use for multiple cursors.

Writing a regex is quick and easy.