2 ms·
The 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 code
by sophacles 14y ago
The 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. )