5 ms·
I can't imagine a situation where I'd need to join text this way, but it's impressive to see the powerful functions possible with vim. thanks for sharing!
by jakejake 14y ago
I can't imagine a situation where I'd need to join text this way, but it's impressive to see the powerful functions possible with vim. thanks for sharing!
- alecbenzer 14y agoI think the point was to be impressed with the example.
- sophacles 14y agoThe other day I had this exact situation. I didn't wan't to futz around with writing my own script to generate code, and the values I needed had to be hard coded into defines anyway, so I just created a empty line below my defines, then did: :r !$SHELL_COMMAND_TO_PRINT_SOME_VALS to get the values in the buffer below where I had already done the series of #define NAME1 ... #define NAMEN so I just needed to move the values I read into the buffer up to the defines. (using the block select method). Anyway, now that you know about it, you may find yourself using this trick more :) (I usually use it in context of config files and :r !ls than programming, but the above was my most recent. )