hanschen / vim-ipython-cell

Seamlessly run Python code in IPython from Vim
GNU General Public License v3.0
331 stars 18 forks source link

Option to use `cpaste` and actually pasting the cell into the REPL instead `paste` #31

Closed Edenhofer closed 3 years ago

Edenhofer commented 3 years ago

While paste is nice and simple, it only works if ipython can correctly read the clipboard. This for example is not possible if the ipython session is on a remote machine. Using cpaste and actually pasting the content of the current cell makes the process more explicit and works across devices. An option to enable this behavior would allow for the best of both worlds.

Since I work on various remote machines quite a lot I would greatly appreciate such a feature.

hanschen commented 3 years ago

Try the :IPythonCellExecuteCellVerbose command. It uses cpaste and doesn't require clipboard support.

(On a related note, paste also works for me on remote machines using ssh and tmux, not sure why it doesn't work for you.)

Closing this issue, feel free to re-open if the verbose command isn't sufficient.

Edenhofer commented 3 years ago

Thanks! IPythonCellExecuteCellVerbose works like a charm.

I am terribly sorry for the noise. I misinterpreted the description as to mean that it just copies over the code 1:1 without cpaste which would be something different.

Btw. my description was referring to a setup where vim and tmux is run locally and an ipython shell is running over ssh in one of the tmux windows.

hanschen commented 3 years ago

Great to hear! I've made a small update to the README to hopefully make this clearer.

Btw. my description was referring to a setup where vim and tmux is run locally and an ipython shell is running over ssh in one of the tmux windows.

Ah I see, yes then it probably won't work. In my case both tmux and vim, in addition to ipython, are run remotely.

Edenhofer commented 3 years ago

Awesome! Now it certainly is very clear. Though it is my fault to begin with for not trying to falsify my hypothesis.

Anyways, thanks for clarifying this and your quick reply!