Hacker News new | ask | show | jobs
by chousuke 1854 days ago
I think I would've used something like :s/'\(.*\)',/'\1': Enum.\1,/g and then ctrl-v to block-select all the first characters and U to uppercase them.

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.

1 comments

I’m often fallback on the sed match-replace strategy for things like this.