I regularly copy blocks of code into spark-shell and run the block using
:paste
ctrl-d
Sometimes it errors because another line of code is required first e.g. an import. Once I have added any other requirements in, I would like to rerun the whole pasted block. Is there a shortcut for doing this, rather than re-copying it, re-pasting? Something like reverse search but for whole blocks.
You can try to put together all the blocks in a file and run