Skip to content

skt041959/nvim-ipy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a IPython/Jupyter front-end for Neovim, partially based on ivanov/vim-ipython, but refactored for nvim's plugin architechture and improved async event handling. It supports IPython 2.x and 3.x, including support for non-python kernels. (Using IPython 3.x is recommended, as it is the main platform for development, and 2.x will likely be dropped when this plugin is updated for Jupyter 4.x)

It doesn't have all features of vim-ipython, but it has better support for long-running commands that continously produce output, for instance this silly example:

from time import sleep
for i in range(10):
    sleep(0.5)
    print(i)

Another difference is that :IPython <args> is interpreted just like the command line ipython console <args>, for instance:

Action command
Start new python kernel :IPython
:IPython3 (for python3 kernel)
Connect to existing kernel :IPython --existing
Start kernel in different language :IPython --profile julia (IPython 2)
:IPython --kernel julia (IPython 3)

On IPython2.x, launching a python3 kernel (when this plugin is run in python2, as per default) is supported through a hack that assumes python3 is in $PATH. On IPython3 kernelspec can be used to launch a python3 kernel from nvim-ipy, the same way as from the Jupyter console and notebook. I have tested that this plugin also supports IJulia and IHaskell, but ideally it should work with any Jupyter kernel.

This plugin runs in the python2 host by default, but it is also compatible with the python3 plugin host. There isn't yet any nice interface to configure this, but for now you can edit ~/.nvim/.nvimrc-rplugin~ manually and change the first 'python' to 'python3' on the line

call remote#host#RegisterPlugin('python', '.../nvim-ipy/rplugin/python/nvim_ipy.py', [

This will also launch a python3 kernel per default.

See plugin/ipy.vim for keybindings (you might want to override these)

About

IPython/Jupyter plugin for Neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 92.3%
  • Vim Script 7.7%