3 ms·
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
by chousuke 5y 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.
- heatmiser 5y agoI’m often fallback on the sed match-replace strategy for things like this.