Skip to content

Your first notebook

This tour assumes jOtter is installed and that you have Python with ipykernel, numpy and matplotlib. The quickest setup, in an empty directory:

Terminal window
uv venv && uv pip install ipykernel numpy matplotlib
The whole tour in one clip
Terminal window
jotter tour.ipynb

The file doesn’t exist yet, so jOtter starts an empty notebook with one code cell and says new notebook — w creates tour.ipynb. Nothing is written to disk until you save. At the bottom, the status line shows the kernel starting and then going idle.

jOtter has two modes, like vim. In notebook mode keys act on whole cells: move, run, add, delete. In edit mode you type inside a cell. You start in notebook mode.

  1. Press i to edit the selected cell in insert mode, and type:

    import numpy as np
    x = np.linspace(0, 2 * np.pi, 200)
    print("points:", len(x))
  2. Press Shift+Enter. The cell runs and points: 200 appears below it. The gutter shows the execution count, [1], and how long the run took. You are back in notebook mode.

Press a to add a cell after the current one, then i to edit it, and type:

import matplotlib.pyplot as plt
plt.plot(x, np.sin(x))
plt.show()

Run it with Shift+Enter. The figure appears inline, right under the cell. In notebook mode, press zi to view it fullscreen and any key to come back.

While typing, try Tab after np.: a completion popup lists what numpy offers. Shift+Tab on a name shows its documentation. See Completion and docs.

  1. In notebook mode, press b to add a cell before the selected one.

  2. Press t to turn it into a markdown cell.

  3. Press i and type:

    ## A sine wave
    We plot $y = \sin x$ for $x \in [0, 2\pi]$:
    $$\int_0^{2\pi} \sin x \, dx = 0$$
  4. Press Esc twice: once to leave insert mode, once to leave the cell. The markdown renders, and so does the math.

In notebook mode, j and k select the next and previous cell, gg and G the first and last, and Ctrl+o jumps back to where you were. J and K move the selected cell down and up. X runs every cell from the top. ? shows all the keys.

Press w to save. tour.ipynb is now a normal notebook that opens in JupyterLab, VS Code or anything else. Press q to quit. If there are unsaved changes, jOtter asks whether to save (s), discard them (q), or stay (any other key).