I would like to know how to use vi-like key bindings in a Jupyter console -- not just with ipython, but with any kernel.
Previous answers show this is possible for ipython. So, perhaps there is some flag or config file where this can be specified. Jupyter does not appear to have an equivalent to ipython profile
and giving the same flagged variables as in ipython does not work.
To open a console panel, right-click a notebook and select "New console for notebook". JupyterLab supports action run-in-console which sends the current statement or selected text to console panel for execution.
Code consoles enable you to run code interactively in a kernel. The cells of a code console show the order in which code was executed in the kernel, as opposed to the explicit ordering of cells in a notebook document. Code consoles also display rich output, just like notebook cells.
The IPython directoryIPython stores its files—config, command history and extensions—in the directory ~/. ipython/ by default. If set, this environment variable should be the path to a directory, which IPython will use for user data. IPython will create it if it does not exist.
The Jupyter console documentation almost provides the answer. For the flag, you just need to change the variable name:
jupyter console --kernel=ir --ZMQTerminalInteractiveShell.editing_mode=vi
To set this option globally, you have to add c.ZMQTerminalInteractiveShell.editing_mode='vi'
to $HOME/.jupyter/jupyter_console_config.py
. It's necessary to prefix the 'c.'
, similar to what's created when running ipython profile create
, which the documentation does not specify.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With