Skip to content

Files and paths

jOtter follows the XDG base directory conventions. It writes nothing next to your notebooks except the notebooks themselves.

What Path Notes
Configuration $XDG_CONFIG_HOME/jotter/config.toml, default ~/.config/jotter/config.toml Optional; jotter config opens it in your editor. See Configuration.
Extra grammars $XDG_CONFIG_HOME/jotter/syntaxes/, default ~/.config/jotter/syntaxes/ Optional. .sublime-syntax files (the format bat and Sublime Text use) for languages jOtter has no grammar for. See Syntax highlighting.
Autosaves $XDG_STATE_HOME/jotter/autosave/, default ~/.local/state/jotter/autosave/ One file per notebook, named after its absolute path with / replaced by %. Removed when you save.
Debug log wherever --log points Only written with --log; appended to, never truncated.
External-editor file $TMPDIR/jotter-cell-<pid>.<ext>, default /tmp Exists only while Ctrl+g is open.

The kernel’s own files, such as its connection file, are handled by the Jupyter libraries in their usual runtime directory.

Code cells are highlighted with the grammar for the notebook’s language (language_info.name, else kernelspec.language). When no grammar knows that name, jOtter tries the kernel’s hints: language_info.pygments_lexer, then codemirror_mode. A kernel for a language without a grammar can name a close one there.

To add a grammar, put its .sublime-syntax file in ~/.config/jotter/syntaxes/. It is read at startup alongside the bundled ones; a file that fails to load is skipped with a warning in the log. User grammars are loaded as a set of their own, so one that embeds or includes another language’s grammar (scope:source.python) can’t reach the bundled ones; that part is left uncoloured.

jOtter looks for kernelspecs in the active environment, a .venv or venv next to the notebook, and the standard Jupyter paths. The full search order is in Kernels.

Variable Effect
XDG_CONFIG_HOME, XDG_STATE_HOME Move the config and state directories.
VISUAL, EDITOR The editor for Ctrl+g, in that order; vi if neither is set.
VIRTUAL_ENV, CONDA_PREFIX An activated environment whose kernel is preferred.
JUPYTER_PATH Extra directories to search for kernelspecs.