I can't figure out how to copy lines that I selected/highlighted in IPython in Vim mode to the normal clipboard (to be pasted outside of the IPython shell). Normally, in vim I can yank text using "+y
and paste it somewhere else, but hitting those keys in IPython Vim mode doesn't seem to work. So I end up having to highlight the desired text using my mouse and copying it with Command-C.
This is an annoyance because if I have multiple lines in IPython there will be many junk characters that I have to filter out as seen below:
In [8]: import numpy as np
...: import math
...:
...: print("hi")
...: while(True):
...: break
...:
...: x = 3
...: y = 4
...:
...:
Here I would have to filter out the In [8]
and the ...:
on each line. But selecting using v
or V
appropriately ignores these junk characters.
This answer doesn't say how to do it in Vi mode and also doesn't mention anything about yanking to the system's clipboard.