emjupy-mode (notebook buffers)

Running cells

Key Command Effect
C-c C-c emjupy-execute-cell-and-goto-next Execute, then go to the next cell (making one if this is the last)
S-<return> emjupy-execute-cell-at-point Execute, leaving point where it is
C-c C-e emjupy-execute-cell-at-point Same as S-<return>, for terminals that cannot send it

The kernel

Key Command Effect
C-c C-z emjupy-interrupt-kernel Interrupt the running cell; the kernel and its state survive
C-c M-z emjupy-connect-kernel-interactive Pick a running kernel or spawn one, for this notebook only
C-c C-x C-r emjupy-restart-kernel Restart this notebook's kernel; other notebooks are untouched
C-c C-x C-c emjupy-reconnect-kernel Reopen the socket to the same kernel after a drop; state survives

Moving among cells

Key Command Effect
C-n emjupy-next-line Next line, keeping the column; skips separators
C-p emjupy-previous-line Previous line, keeping the column; skips separators
C-c C-n emjupy-next-cell Move point to the next cell
C-c C-p emjupy-previous-cell Move point to the previous cell
C-c <prior> emjupy-beginning-of-cell Go to the start of this cell
C-c <next> emjupy-end-of-cell Go to the end of this cell's source
M-<up> emjupy-beginning-of-previous-cell Go to the start of the previous cell
M-<down> emjupy-beginning-of-next-cell Go to the start of the next cell
M-<prior> emjupy-end-of-previous-cell Go to the end of the previous cell
M-<next> emjupy-end-of-next-cell Go to the end of the next cell

Changing cells

Key Command Effect
C-c C-a emjupy-insert-cell-above Insert a new code cell above the current one
C-c C-b emjupy-insert-cell-below Insert a new code cell below the current one
C-c C-k emjupy-delete-cell Delete the cell at point
C-c C-s emjupy-split-cell Split the cell at point in two (clears both outputs)
C-c C-j emjupy-join-cell-above Merge this cell into the one above (clears both outputs)
C-c C-t emjupy-cycle-cell-type Toggle the cell between code and markdown
C-c C-w emjupy-copy-cell Copy the cell, without its output
C-c C-y emjupy-yank-cell Insert the copied cell below, not run
C-c <up> emjupy-move-cell-up Move the cell, and its output, one position earlier
C-c <down> emjupy-move-cell-down Move the cell, and its output, one position later
C-c ' emjupy-edit-cell-externally Edit the cell in the shadow buffer in a real major mode
TAB emjupy-indent-or-cycle Indent as Python does; repeated, cycle through indentations

Output, and what a cell shows

Key Command Effect
C-c C-l emjupy-clear-cell-output Discard this cell's output
C-c C-u C-l emjupy-clear-all-outputs Discard every cell's output (asks first)
C-c C-o emjupy-toggle-cell-output Hide or show this cell's output; nothing is discarded (also by clicking the marker)
C-c C-i emjupy-toggle-cell-code Hide or show this cell's code, and its output
C-c C-f emjupy-open-output Open the output at point on its own: a plotly figure or HTML in the browser or an xwidget, an image in an image buffer
C-$ emjupy-show-traceback Show the last traceback in its own buffer
DEL emjupy-latex-unrender-or-delete On a rendered formula, show its source; elsewhere, delete
C-c C-x C-l emjupy-re-render Redraw the notebook from the cells

The notebook, its outline and its servers

Key Command Effect
C-x C-s emjupy-save-notebook Save to the server – on whichever key saves, save-buffer's
C-c C-x b emjupy-switch-notebook Switch to another open notebook, labelled by server
C-c C-x s emjupy-status This notebook's state: server, kernel, language server and why, remote; C-u for every notebook
C-c C-x l emjupy-login Log in to another server (another ssh tunnel)
C-c C-x C-e emjupy-export-py Export the notebook as a plain .py file
M-x emjupy-recover-notebook emjupy-recover-notebook Restore unsaved edits from the recovery copy, after a crash
M-x emjupy-open-this-notebook emjupy-open-this-notebook In an .ipynb file shown as text: open it as a notebook, on a local kernel (EIN's C-c C-o)

The debugger, and the menu of everything

Key Command Effect
C-c C-v emjupy-menu A menu of every command, grouped by what it is for

Outline

Key Command Effect
C-c C-q emjupy-toc Show the outline panel beside the notebook, or hide it
M-g i imenu Go to a heading by name

In the panel: RET or a click goes to a heading, n and p move between them, g draws it anew, q hides it.

Debugger (C-c C-d)

Key Command Effect
C-c C-d d emjupy-debug-mode Start or stop debugging this notebook's kernel
C-c C-d b emjupy-debug-toggle-breakpoint Set or remove a breakpoint on this line
C-u C-c C-d b emjupy-debug-toggle-breakpoint One that stops when a condition holds
C-c C-d x emjupy-debug-break-on-exceptions When to stop on an exception
C-c C-d f emjupy-debug-frame Choose a frame of the stack stopped in
C-c C-d n emjupy-debug-next Run the line stopped at
C-c C-d s emjupy-debug-step-in Step into the call on this line
C-c C-d o emjupy-debug-step-out Run on out of this function
C-c C-d c emjupy-debug-continue Go on to the next breakpoint
C-c C-d e emjupy-debug-evaluate Evaluate an expression where it stopped
C-c C-d v emjupy-debug-variables Show the variables where it stopped

With repeat-mode on, n, s, o and c repeat without the prefix.

emjupy-shadow-edit-mode (C-c ' on a code cell)

Key Command Effect
C-c C-c emjupy-commit-shadow-edit Write edits back into the notebook cells and return
C-c ' emjupy-commit-shadow-edit Same as C-c C-c
C-c C-k emjupy-abort-shadow-edit Discard edits and return to the notebook

The shadow buffer holds every code cell, as one Python file.

emjupy-cell-edit-mode (C-c ' on a markdown cell)

Key Command Effect
C-c C-c emjupy-commit-cell-edit Write the edit back into the cell and return
C-c ' emjupy-commit-cell-edit Same as C-c C-c
C-c C-k emjupy-abort-cell-edit Discard the edit and return to the notebook

The same keys mean different things in an edit buffer and in the notebook. C-c C-c runs the cell in the notebook, but commits an edit. C-c C-k deletes the cell in the notebook, but discards an edit. C-c ' opens an edit buffer from the notebook, and commits from it.

Server dashboard

Its keys are in Using a notebook: open, go up, refresh, shut a kernel down, create, hand to Dired.

Unbound commands (M-x only)

Command Effect
emjupy-open-notebook Open a notebook by path on a given server
emjupy-list-notebooks Prompt with the server's notebook list
emjupy-create-notebook Create a new blank notebook on the server
emjupy-trust-notebook Trust it, as Jupyter does: its scripts then run
emjupy-run-all-cells Run every cell, in order, as JupyterLab
emjupy-run-cells-above Run the cells above this one
emjupy-run-cells-below Run this cell and those below
emjupy-rename-notebook Rename the notebook on the server
emjupy-save-notebook-as Save as another notebook, and go on there
emjupy-duplicate-notebook Copy the notebook beside it, and open it
emjupy-revert-to-checkpoint Go back to the checkpoint saving made
emjupy-refresh-appearance Re-derive page colours from the theme and redraw

Completion (M-TAB) and eldoc need no emjupy binding: they are wired into the standard hooks and reach the language server through the shadow buffer automatically.

On a widget

Key Does
<left>, <right> Step the number at point: a slider, a bounded field
RET, click Use the control: step, toggle, choose one or several, click a button; on a value, ask for a new one