Closed astier closed 4 years ago
That's a cool idea (I didn't know about ipython-cells before), but I think I want to keep vim-ipython-cell as it currently is with support for Vim marks and no dependency on ipython packages (although you're right that this would get rid of xsel/xclip dependency).
So instead, I encourage you to develop a separate Vim plugin that addresses this need. If you're new to Vim plugin development you could use this plugin as a starting point, the actual functionality should be relatively straightforward to implement in Python.
Hi. Thanks for the advice. Although my idea has some benefits I think there are also reasons against it. Your approach to define cells which are not just bound to ipython is more generic. Creating cell-objects would be cool such that operations like dac
(delete around cell) would be possible. But this are just ideas. Right now I have no time. Need to focus on studies. Lost already to much time tweaking vim haha
There is a package ipython-cells which enhances ipython with commands like
%cell_run cell_name
to run cells with the specified name directly from ipython. The cell-name is specified via comments in the code similar how you do it. Take a look at the link above for better explanation. My proposal would be to use this as the backend to define and run cells.Basically you would define cells as required by the package ipython-cells. Commands like
:IPythonCellExecuteCell
would simply search for the magic comment with the cell-name. Then it could just send via slime to ipython the commandcell_run cell-name
to execute the cell.This would have the following benefits:
%cell_run cell-name
is more expressive than%paste -q
. you immediatly can see in the screen and in the ipython-history which cells were executed