Repository navigation
Configuration
gpython has no settings screen. You change a setting in one of two ways:
- Type a
:setcommand (or press its key) while gpython runs. gpython saves the setting in the config file. - Edit the config file.
Each later session starts with the saved settings.
On this page:
- The config file
- Settings
- Bottom bar settings
- Debugger settings
- Experimental settings
- Data that gpython saves for each notebook
- Environment variables
- Files and folders that gpython uses
| Condition | Location |
|---|---|
| Default | ~/.config/gpython/config.toml |
XDG_CONFIG_HOME is set |
$XDG_CONFIG_HOME/gpython/config.toml |
gpython makes the file and its folder the first time it saves a setting.
The file is TOML. A value is a string, true / false, or an integer. gpython ignores other value types.
theme = "nord"
vim = true
run_mode = "lazy"
line_numbers = true
timing = false
concurrent = false
icons = true
[status]
cpu = false
clock_format = "%H:%M"A key in a table is the same as a key with a dot.
[status] with cpu = false is the same as "status.cpu" = false.
- gpython writes the full file again each time it saves a setting. It removes your comments.
- After a save, table keys show in the dotted form:
"status.cpu" = false. The meaning is the same. - If the file has a syntax error, gpython ignores the full file and uses the defaults. The next saved setting then replaces the file. Correct the error before you change a setting in gpython.
| Setting | Command or key | Key in config.toml
|
Default |
|---|---|---|---|
| Vim keys in the editor |
:set vim / :set novim
|
vim = true |
on |
| Line numbers |
:set nu / :set nonu, l in cell mode |
line_numbers = true |
on |
| Cursor shape in insert mode |
:set cursor=block, bar or underline
|
insert_cursor = "bar" |
block |
--no-vim on the command line turns the vim keys off for one session.
| Setting | Command or key | Key in config.toml
|
Default |
|---|---|---|---|
| Run mode |
:set lazy / :set nolazy, f3, :lazy
|
run_mode = "lazy" or "reactive"
|
lazy |
| Run time in cell headers |
:set time / :set notime, t in cell mode, :time
|
timing = true |
off |
| Concurrent cells |
:set concurrent / :set noconcurrent
|
concurrent = true |
off |
| Maximum cells at the same time | :set concurrency=N |
concurrency = 4 |
cores + 4, maximum 32 |
| Check shared names after a group |
:set concurrent_verify / :set noconcurrent_verify
|
concurrent_verify = true |
on |
See Running cells for the run mode and Concurrent cells.
| Setting | Command or key | Key in config.toml
|
Default |
|---|---|---|---|
| Install missing modules and do not ask |
:set autoinstall / :set noautoinstall
|
autoinstall = true |
off |
| How gpython installs a missing module | Your selection in the install prompt | install_mode |
uv pip install |
See Missing modules.
| Setting | Command or key | Key in config.toml
|
Default |
|---|---|---|---|
| Theme |
:theme name, ctrl+t
|
theme = "nord" |
terminal |
| Bottom bar |
:set statusbar / :set nostatusbar
|
status_bar = true |
on |
| Folder icons in the file explorer |
:set icons / :set noicons
|
icons = true |
on |
The folder icons come from a Nerd Font. If the font of your terminal
is not a Nerd Font, the explorer shows empty boxes. Then use :set noicons.
See Folder icons.
| Setting | Command or key | Key in config.toml
|
Default |
|---|---|---|---|
Keep the # %% lines of a .py file |
:set markers / :set nomarkers
|
markers = true |
on |
With markers = false, each save writes a .py file without # %% lines.
:clean does this one time, for the open file. See File formats.
--theme NAME on the command line sets the theme for one session.
These keys have no :set command. Put them in the config file.
| Key | Meaning | Default |
|---|---|---|
status.layout |
The modules and their sequence | "mode clock host cpu ram gpu" |
status.clock_format |
A strftime pattern for the clock |
"%a %d %b %H:%M" |
status.style |
"btop" draws graphs. "tmux" draws one level symbol in brackets |
"btop" |
status.clock, status.host, status.cpu, status.ram, status.gpu
|
false removes that module |
true |
status_bar = true
[status]
cpu = false
layout = "mode clock host ram"
clock_format = "%H:%M"
style = "tmux"See Bottom bar for what each module shows.
| Setting | Command | Key in config.toml
|
Default |
|---|---|---|---|
| How much the debugger records |
:set debug_detail=full, auto, balanced or lean
|
debug_detail = "full" |
full |
| Maximum memory | :set debug_history=20MB |
debug_history |
from debug_detail
|
| Maximum steps | :set debug_events=N |
debug_events |
from debug_detail
|
| Make old iterations thinner |
:set debug_thinning=on or off
|
debug_thinning |
from debug_detail
|
| Maximum characters of a value | :set debug_repr_chars=N |
debug_repr_chars |
from debug_detail
|
| Maximum items in a strip | :set debug_strip_items=N |
debug_strip_items |
from debug_detail
|
| Maximum grid size | :set debug_grid_size=N |
debug_grid_size |
from debug_detail
|
| Statistics for arrays |
:set debug_stats=watched, cpu or off
|
debug_stats |
watched |
:set debug_history? shows the value in effect and where it comes from. This works for each debug_ key.
The values of each preset are in How much is recorded.
| Key | Meaning | Default |
|---|---|---|
experimental.true_markdown |
Draw markdown headings h1 to h3 in a large font, as images |
off |
[experimental]
true_markdown = trueSee Large headings.
gpython also writes these keys into the config file. Do not edit them.
| Key | Value | Written when |
|---|---|---|
"env:<full path of the notebook>" |
The Python program of the environment that the notebook used last | You change the environment of a notebook |
"uv:<full path of the project>" |
The --extra and --group flags for that uv project |
:sync installs an extra or a group |
To make gpython forget the environment of a notebook, delete its env: line.
| Variable | Effect |
|---|---|
XDG_CONFIG_HOME |
Moves the config file to $XDG_CONFIG_HOME/gpython/config.toml
|
XDG_CACHE_HOME |
Moves the picture cache to $XDG_CACHE_HOME/gpython/images
|
GPYTHON_HOME |
Moves ~/.gpython (cell layouts and outputs) to this folder |
GPYTHON_KITTY_IMAGES=0 |
Does not use the kitty graphics protocol for images |
GPYTHON_BIG_HEADINGS=0 |
Does not draw large markdown headings |
GPYTHON_TTY_LOG=file |
Writes each byte that gpython sends to the terminal into file. cat file plays the session again |
TEXTUAL_FPS |
Maximum frames each second. gpython sets 120 if you do not set it |
| Variable | Use |
|---|---|
TMUX |
When it is set, gpython does not use the kitty graphics protocol |
VIRTUAL_ENV, CONDA_PREFIX
|
The environment picker lists this environment |
WORKON_HOME |
The environment picker searches this folder |
UV_PYTHON_INSTALL_DIR |
Where uv keeps its Python versions. Default ~/.local/share/uv/python
|
UV_PROJECT_ENVIRONMENT |
The environment folder of a uv project. Default .venv in the project |
PATH |
The environment picker lists each python3 and python3.x on it |
| Location | Contents | Written when |
|---|---|---|
~/.config/gpython/config.toml |
Settings, and the data for each notebook | You change a setting |
~/.gpython/cells/ |
Cell layout of plain .py notebooks and outputs of all .py notebooks |
You save or run a .py notebook |
~/.cache/gpython/images/ |
Pictures that markdown cells downloaded | A markdown cell loads a picture from the internet |
| The folder of the notebook | Images that you save with s or :img save
|
You save an image |
<temporary folder>/gpython/ |
Images that you open in the browser |
o, :img open, the View button |
<temporary folder>/gpython-kernel-*.json |
The connection file of a kernel | A kernel starts |
<temporary folder>/gpython-uv-*.log |
What uv printed when it started a kernel | A kernel starts in a uv project |
gpython saves a plain .py notebook without # %% lines. Thus the script stays an ordinary script.
The data that does not fit in the script goes into this folder:
| File | Contents |
|---|---|
<content>/<path>.json |
Where each cell starts and ends, which cells are markdown, which cells have hidden code |
<content>/<path>.out.json |
The last outputs, the run number and the run time of each code cell |
by-path/<path>.json |
The text and the cell layout that gpython last saved for this location |
by-path/<path>.out.json |
The code of each cell and the outputs that gpython last stored for this location |
<content> is a hash of the text of the file. <path> is a hash of the location of the file.
A .py file with # %% lines and a marimo notebook have only the .out.json files.
Rules:
- If you move, rename or copy a file and do not change it, gpython finds the layout again from the text.
- If a different program changes the file, gpython compares it with the
by-pathfiles. It keeps the cells and the outputs that are still there. A cell with changed code shows its old output and is marked stale. See File formats. - If no cell is left, or the file was never saved by gpython, gpython divides the file into cells again.
- gpython deletes entries that it did not read or write for 30 days. It does this check a maximum of one time each day.
It is safe to delete this folder. You lose only the cell borders of plain scripts and the saved outputs.
gpython does not install ipykernel into a uv project, and it does not change pyproject.toml
unless you use uv add (from the install prompt, :uv add or the environment picker).
Use the notebook
- Getting started
- Command line
- Running cells
- Keys
- Commands
- Vim
- Markdown cells
- Variables and the debugger
- Images
Set up the workspace
Help and project