After that you can just select it again in visual mode and g Ctrl-A to get the right numbers.
If anything the g Ctrl-A part makes Vim way better than most multicursor editors.
Though I did make a mistake, if you selected everything it'd catch the name numbers too, so you'd have to go into visual block mode and only select the enum parts, then do g Ctrl-A.
That said the numbers probably weren't supposed to be taken seriously now that I think about it.
You don't have to learn command. You simply need to know how to edit with VIM.
And multi cursors only work for tabular data. The macro recordings can work for the entire document where you call a macro on a word/regex you searched for, for example.
This was a bigger problem when Apple decided to go with those butterfly keys.
There are several plugins which allow for more complex use of multiple cursors.
:g/<regex>/<command>
is the general form for [g]rabbing lines that match a regex and applying a command over them. You can also chain the command:
:g/<regex1>/g/<regex2>/<command>
I'll admit this isn't exactly something you intuit as easily as a drop-down menu, but (neo)vim does have tools for all these things out of the box.
```
Vjj:s/\v'(.*)',/'\1': Enum.\u\1,/
```This is all just muscle memory. It seems impossible until you get used to it, and then it's the most natural thing in the world.
I know I’ve read that part of the documentation before, but probably not for over five years. In cases where I’ve wanted something like that, I’ve tended to reach for macros, visual block editing, and s/\=. A few days ago I did a somewhat more complicated one that s/\U wouldn’t be sufficient for:
:'<,'>s/.*/\=" pub const ".substitute(toupper(submatch(0)), "[^A-Z0-9]\+", "_", "g").": &'static str = \"".submatch(0)."\";"Vi's not always about finding the most efficient way to do something, but having a composable language to do tricks like these comfortably builds up into your own dialect over time.
I also like using
:g/^/norm $normal_commands
to apply anonymous macros across all lines. It works with visual selections too: :'<,'>g/^/norm $normal_commands
And naturally you can replace the ^ with any regex to selectively apply the macro to only lines that match!I saw a colleague doing the same thing (turn column of #defines into structs in an array) with multiple cursors in an IDE, took him much longer.
I paused to take a drag from my smoke while doing that.
I think you meant just vU, as you were only capitalising the letter under the cursor.
You can actually also achieve this without entering visual mode: gU{motion} changes to uppercase, so gUl uppercases the letter under the cursor.
In vim it was something like qdyi'f,i: Enum.<Esc>pbvlUq and then repeat macro.
I found it very slow to even recall.
For some reason the multicursor solution feels faster to me most times.