Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Installation

Alisue edited this page Feb 17, 2016 · 8 revisions

With IPython-notebook-extensions (Recommended)

[IPython-notebook-extensions][] contains a collection of extensions that add functionality to the [Jupyter notebook][]. These extensions are mostly written in javascript and will be loaded locally in your browser.

The project simplifies the task of maintaining multiple extensions as, all extensions that are maintained and active have a markdown README file for documentation and a YAML file to allow them being configured using the nbextensions server extension.

Install IPython-notebook-extensions

Follow the instructions at https://github.com/ipython-contrib/IPython-notebook-extensions#installation. In a nutshell, clone the repository and run python setup.py install to install as a local user.

Add vim_binding to IPython-notebook-extensions

Once you have installed IPython-notebook-extensions, run the following from a shell (e.g. bash):

# You may need the following to create the directoy
$ mkdir -p $(jupyter --data-dir)/nbextensions
# Now clone the repository
$ cd $(jupyter --data-dir)/nbextensions
$ git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding
$ chmod -R go-w vim_binding

Activate the extension

Launch a [Jupyter notebook][] session. Then, in a browser, go to <root>/nbextensions/; for example, if the notebook is hosted under localhost:8888, go to http://localhost:8888/nbextensions/. Activate VIM binding from the list of extensions. Check documentation for more details.

Without using IPython-notebook-extensions

If you don't use [IPython-notebook-extensions][], the second choice is using git clone or download the repository to directly install. First of all, clone or download the repository into Jupyter's data directory by running the following from a shell (e.g. bash):

Clone or download the extension

By using git clone (recommended)

# You may need the following to create the directoy
$ mkdir -p $(jupyter --data-dir)/nbextensions
# Now clone the repository
$ cd $(jupyter --data-dir)/nbextensions
$ git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding

By using jupyter command

# You may need the following to create the directoy
$ mkdir -p $(jupyter --data-dir)/nbextensions/vim_binding
# Not download a plugin file
$ jupyter nbextension install https://rawgithub.com/lambdalisue/jupyter-vim-binding/master/vim-binding.js --nbextensions=$(jupyter --data-dir)/nbextensions/vim_binding/vim_binding

On Linux, either command should create a new file under ~/.local/share/jupyter/nbextensions/vim_binding On Mac OS X, this path should be ~/Library/Jupyter/nbextensions/vim_binding

Activate the extension

To activate the extension permanently, execute the following from a shell (e.g. bash):

$ jupyter nbextension enable vim_binding/vim_binding

Activate from a notebook (optional)

Run the following in a code cell:

%%javascript
Jupyter.notebook.config.update({
  'load_extensions': { 'vim_binding/vim_binding': true },
});

Activate temporarily in the current session

Once after you have installed jupyter-vim-binding, restart your Jupyter server and then, run the following in a code cell:

%%javascript
Jupyter.utils.load_extensions('vim_binding/vim_binding');

Then [IPython Notebook]: http://ipython.org/notebook.html [IPython-notebook-extensions]: https://github.com/ipython-contrib/IPython-notebook-extensions

Clone this wiki locally