I use Python and Julia and use the REPL a lot in both.
One thing I really like in the Python ecosystem is IPython (yes, I’m aware of IJulia ).
One particular feature I use a lot of in IPython is the
%paste magic command, which takes the contents of your copy-buffer and submits them to the REPL, without showing the pasted text or entering it in your history.
I wanted something similar in the plain Julia REPL and came up with this macro:
# ~/.juliarc.jl module __magic__ export @paste """Evaluate the copy buffer""" macro paste() include_string(clipboard()); end end importall __magic__
Then, in the REPL I can simply do:
and whatever text I have copied will be evaluated in the Julia REPL.
Hopefully this is useful to someone!