top | item 29470067

(no title)

marklgr | 4 years ago

Multiple-cursor editing is a nice and cool feature, and for what it's worth there are some vim plugins to get it in vim, but let's see the alternative:

- multiple-cursor: select non-contiguous pieces of text, then edit them all at once.

- vim macro/repeat: edit a piece of text, and repeat on similar occurrences.

The vim "way" could be, `/;$` to select the trailing semi-colon, then `cgn` to edit it (enter the curly block once in insert mode, then exit with `<Esc>`), and now you can repeat on the next trailing semi-colon simply by hitting `.` (dot).

So, instead of first looping on the occurrences to get multiple cursors, then do the editing, you first do the editing on an occurrence, and you loop on the editing. There is admittedly less of a "wow" factor, but I don't think it is any less powerful.

(edited for formatting).

discuss

order

edanm|4 years ago

It is way harder to use macros than to do multiple-cursor editing, especially for the kind of fast changes that happen 10 times a day. The difference is between seeing interactively exactly what you are doing and where something is going wrong (with multiple cursors), vs. recording a macro, replaying it, realizing you forgot to do something like use the correct keybinding, rerecording, etc.

I say this as a huge vim advocate, who used vim exclusively for 8 years before switching to emacs and lately to vscode.

Vim gets a lot of things right, and there's no comparison to using vim-style editing. But multiple-cursor editing is a killer feature that really does improve your workflow a lot of the time. Luckily most editors have some version of it now, though often not as good as the original and doesn't always play nicely with the various vim modes.

xtiansimon|4 years ago

Maybe because I’m also a maker I don’t expect my tools to do everything… what’s wrong with using vim for what it does very well, and then Sublime (geany, kate) when a gui is just easier?