jpalardy / vim-slime

A vim plugin to give you some slime. (Emacs)
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/
MIT License
1.9k stars 227 forks source link

Send code to qtconsole? #377

Open ANP-Oxy opened 1 year ago

ANP-Oxy commented 1 year ago

Hello i’m new NeoVim user and I was wondering is there a way to send the code using vim-slime to jupyter Qtconsole just like how it sends it to ipython console. The ipython console by itself can’t render plots inline but qtconsole can. I really like vim-slime and was wondering if this is possible

jpalardy commented 1 year ago

Hi @ANP-Oxy 👋

The short answer is: I don't know 😆

All vim-slime does it "execute a shell command with text you selected" — the magic comes from screen, tmux, wezterm, etc … having commands to inject/paste text into themselves from the outside, something that can be scripted.

If you're willing to research that for Qtconsole, you'll already be 70% of the way toward a solution.

Let me know what you find

ANP-Oxy commented 1 year ago

I tried using other plugins that allow you to connect to ipython kernels but they aren't working due to being outdated. Vim-ipython, vim-ipy, jupyter-vim none of the them are working for me. I tried looking into what I could find about jupyter Qtconsole in the documentation. here are the docs this is one section from them

this is another link that could be useful

The other plugins might have some hint as to how to connect to an jupyter kernel the only problem is I don't understand shell scripting or other languages that they use

jpalardy commented 1 year ago

Hi @ANP-Oxy

I don't have the bandwidth to personally take this on (and I'm not a jupyter Qtconsole either)

If you attempt a prototype, that's another matter.

You could also try to find someone else to team up for a solution.

RyanGreenup commented 4 months ago

I think this would be great!

There is a similar plugin jupyter-vim that connects to the QtConsole, this could be used for insight.

One can also use jupytext.vim to edit as a pyscript seemlessly and then preview with something like !jupyter nbconvert "%" --to markdown<CR> :vscplit "%:r".md.

See Also: