Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm surprised everyone's forgetting vim already has a proto-multicursor mode. Go into Visual Block mode (Ctrl-V) select all the lines then it's just A<delete ,>: Enum.Name0,

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.



So the second time, you're entering Visual Block mode or plain Visual mode? What does the g Ctrl+A do?


g Ctrl-A increments all the numbers, but every instance gets incremented by one than the previous. First line would be Enum1, second Enum2, third Enum3. It's a really neat feature imo.

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.


Thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: