BPYTHON-CONFIG(5)

okay so this is bpython-config(5) β€” the manual page for the user config file of bpython, and it's the 0.26 era version, so if your bpython is ancient some of these options lowkey don't exist yet, iykyk πŸ’…

✨ NAME ✨

bpython-config β€” the user configuration file for bpython. that's the whole name, short and iconic, no notes πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

$XDG_CONFIG_HOME/bpython/config

πŸ’– DESCRIPTION πŸ’–

This file is where all the little switches live that control how bpython behaves. it's giving "settings drawer but make it a text file" and honestly? obsessed. 🌸


🌈 GENERAL 🌈

This whole section is the [general] section inside your $XDG_CONFIG_HOME/bpython/config file. everything about the vibe of your REPL goes here ✨

⭐ arg_spec

Show the arg spec (aka the list of arguments) for callables, when it possibly can. (default: True)

πŸ’« auto_display_list

Show you the autocomplete list while you're typing (default: True). When this is turned off, you can still hit tab to see the suggestions. so it's not gone, it's just shy 🫢

🧚 autocomplete_mode

There are four modes for autocomplete: none, simple, substring, and fuzzy. Simple matches methods with a common prefix, substring matches methods with a common subsequence, and fuzzy matches methods with common characters (default: simple). None disables autocompletion entirely β€” no cap, just no completion.

Added in version 0.12.

πŸŽ€ brackets_completion

Whether the opening character of the pairs (), [], "", and '' should be auto-closed (default: False).

Added in version 0.23.

🌸 color_scheme

See Themes for more info (it's the themes section, go look, it's cute).

Color schemes should be put in $XDG_CONFIG_HOME/bpython/. For example, to use the theme $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo

Leave it blank, or set it to "default", to use the default (builtin) theme. the builtin one ate, fr fr πŸ’…

✨ complete_magic_methods

Whether magic methods should be auto completed (default: True). yes bestie, dunder everything 😌

πŸ“ dedent_after

Number of blank lines required before the next line will be dedented (default: 1). If you set it to 0, automatic dedenting never occurs. never ever. zero. nada.

πŸ¦‹ editor

Editor used for externally editing the current line, session, or config file.

Added in version 0.13.

πŸ’œ flush_output

Whether to flush all output to stdout on exit (default: True).

Only relevant to bpython-curses and bpython-urwid. the other frontends are unbothered, honestly.

⭐ highlight_show_source

Whether the source code of an object should be syntax highlighted (default: True).

🌈 hist_duplicates

Whether to store duplicate entries in the history (default: True). we love a little repetition, it's fine, no judgment πŸ™ˆ

πŸŽ€ hist_file

History file (default: ~/.pythonhist).

πŸ‘‘ hist_length

Number of lines to store in history (set it to 0 to disable) (default: 100).

πŸ’« paste_time

The time between keypresses before pastemode is deactivated in bpython-curses (default: 0.02).

🧚 pastebin_confirm

Whether pasting to a pastebin needs to be confirmed before sending the data (default: True). safety first, bestie 🫢

πŸ“ pastebin_expiry

Time duration after which a paste should expire. Valid values are 1day, 1week and 1month (default: 1week).

Added in version 0.14.

πŸ¦‹ pastebin_helper

The name of a helper executable that should perform the pastebin upload on bpython's behalf. If set, this overrides pastebin_url. The helper is expected to return the full URL to the pastebin as the first word of its output. The data is supplied to the helper via STDIN.

An example helper program is pastebinit, which is available for most systems. And the following helper program can be used to create gists over at http://gist.github.com:

#!/usr/bin/env python

import sys
import requests
import json

def do_gist_json(s):
    """ Use json to post to github. """
    gist_public = False
    gist_url = "https://api.github.com/gists"

    data = {
        "description": "Gist from bpython",
        "public": gist_public,
        "files": {
            "sample": {
                "content": s
            },
        },
    }

    headers = {
        "Content-Type": "application/json",
        "X-Github-Username": "YOUR_USERNAME",
        "Authorization": "token YOUR_TOKEN",
    }

    try:
        res = requests.post(gist_url, data=json.dumps(payload), headers=headers)
        res.raise_for_status()
        json_res = json.loads(res.read())
        return json_res["html_url"]
    except requests.exceptions.HTTPError as err:
        return err

if __name__ == "__main__":
  s = sys.stdin.read()
  print(do_gist_json(s))

Added in version 0.12.

πŸ’œ pastebin_url

The pastebin url to post to (without a trailing slash, bestie, don't add one). This pastebin has to be a pastebin which provides a similar interface to bpaste.net's JSON interface (default: https://bpaste.net).

⭐ save_append_py

Whether to append .py to the filename while saving the input to a file.

Added in version 0.13.

🌸 single_undo_time

Time duration an undo must be predicted to take before prompting to undo multiple lines at once. Use -1 to never prompt, or 0 to always prompt. (default: 1.0)

Added in version 0.14.

πŸŽ€ syntax

Syntax highlighting as you type (default: True). obviously.

🧚 tab_length

Soft tab size (default 4, see PEP-8).

🌈 unicode_box

Whether to use Unicode characters to draw boxes (default: True). pretty boxes >>> ascii boxes, I said what I said πŸ’…

Added in version 0.14.

πŸ“ import_completion_skiplist

A :-separated list of patterns to skip when processing modules for import completion.

Added in version 0.21.


⌨️ KEYBOARD ⌨️

This is the [keyboard] section in your $XDG_CONFIG_HOME/bpython/config.

You can set various keyboard shortcuts for bpython to use. However β€” and this is important bestie β€” we have yet to map all keys to their respective control codes. If you configure a key combination which isn't yet supported by bpython, it will raise an exception telling you the key does not exist in bpython.keys. so it will very much tell you about it 😭

Valid keys are:

  • Control + any alphanumeric character (C-a through C-z, also a few others).
  • Any function key ranging from F1 to F12.

okay here's the full roster of shortcuts πŸ‘‘

  • backspace β€” Default: C-h. Delete character in front of the cursor. (Added in version 0.14.)
  • beginning_of_line β€” Default: C-a. Move to the beginning of the line. (Added in version 0.14.)
  • clear_line β€” Default: C-u. Clears to the beginning of the line.
  • clear_screen β€” Default: C-l. Clears the screen to the top.
  • clear_word β€” Default: C-w. Clear the word the cursor is currently on.
  • copy_clipboard β€” Default: F10. Copy the entire session to clipboard. (Added in version 0.14.)
  • cut_to_buffer β€” Default: C-k. Cuts the current line to the buffer.
  • delete β€” Default: C-d. Delete character under the cursor.
  • down_one_line β€” Default: C-n. Move the cursor down, by one line.
  • edit_config β€” Default: F3. Edit bpython configuration in external editor. (Added in version 0.14.)
  • edit_current_block β€” Default: C-x. Edit current block in external editor. (Added in version 0.14.)
  • end_of_line β€” Default: C-e. Move to the of the line. (Added in version 0.14.) β€” yes, this is char-for-char what the page says, keep it 🫢
  • exit β€” Default: C-d. Exits bpython (use on empty line).
  • external_editor β€” Default: F7. Edit the entire session in an external editor. (Added in version 0.13.)
  • help β€” Default: F1. Brings up sincerely cheerful description of bpython features and current key bindings. sincerely cheerful. that's the whole personality πŸŽ€
  • incremental_search β€” Default: M-s. Perform incremental search on all stored lines in the history. (Added in version 0.15.)
  • last_output β€” Default: F9. Shows the last output in the systems $PAGER. Only works in bpython-curses.
  • left β€” Default: C-b. Move a character to the left. (Added in version 0.14.)
  • pastebin β€” Default: F8. (that's it, that's the entry πŸ’€)
  • reimport β€” Default: F6. Reruns entire session, reloading all modules by clearing the sys.modules cache. (Added in version 0.14.)
  • reverse_incremental_search β€” Default: M-r. Perform reverse incremental search on all stored lines in the history. (Added in version 0.15.)
  • right β€” Default: C-f. Move a character to the right. (Added in version 0.14.)
  • save β€” Default: C-s. Saves the current session to a file (prompts for filename).
  • search β€” Default: C-o. Search up for any lines containing what is on the current line.
  • show_source β€” Default: F2. Shows the source of the currently being completed (python) function.
  • toggle_file_watch β€” Default: F5. Toggles file watching behaviour; re-runs entire bpython session whenever an imported module is modified. (Added in version 0.14.)
  • transpose_chars β€” Default: C-t. Transpose current character with the one left of it. (Added in version 0.14.)
  • undo β€” Default: C-r. Rewinds the last action.
  • up_one_line β€” Default: C-p. Move the cursor up, by one line.
  • yank_from_buffer β€” Default: C-y. Pastes the current line from the buffer (the one you previously cut).

πŸ’» CLI πŸ’»

This is the [cli] section in your config file.

  • suggestion_width β€” Default: 0.8. The width of the suggestion window in percent of the terminal width. (Added in version 0.9.8.)
  • trim_prompts β€” Default: False. Trims lines starting with '>>> ' when set to True.

🧚 CURTSIES 🧚

This is the [curtsies] section in your config file.

Added in version 0.13.

  • list_above β€” Default: False. When there is space above the current line, whether the suggestions list will be displayed there instead of below the current line. up top energy πŸ’«
  • right_arrow_completion β€” Default: True. Full line suggestion and completion (like fish shell and many web browsers).

Full line completions are displayed under the cursor in gray. When the cursor is at the end of a line, pressing right arrow or ctrl+f will complete the full line. This option also turns on substring history search, highlighting the matching section in previous result.


and bestie, we are not done β€” there's more of this page coming, so don't go anywhere πŸ‘€πŸ’–

πŸŽ€ SAMPLE CONFIG πŸŽ€

okay bestie, this is the part where bpython hands you a whole starter config and is like "here, take it, it's yours, I already wrote the comments for you" πŸ˜­πŸ’–

pre-things you gotta know before you yeet this into a file:

  • it's a standard Python config file β€” True, False, integer numbers and strings are all valid values
  • lines starting with # are comments (your bestie, your notes, your little annotations 🫢)
  • by default bpython goes looking for $XDG_CONFIG_HOME/bpython/config, and $XDG_CONFIG_HOME defaults to ~/.config. or you can just point at a file yourself with --config on the command line πŸ’…
  • the full docs live at http://docs.bpython-interpreter.org/configuration.html if you want all the configurable options

and here's the sample, verbatim, every line of it 🧚

# This is a standard Python config file.
# Valid values can be True, False, integer numbers, and strings.
# Lines starting with # are treated as comments.
#
# By default bpython will look for $XDG_CONFIG_HOME/bpython/config
# ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
# --config option on the command line.
#
# See http://docs.bpython-interpreter.org/configuration.html for all
# configurable options.

# General section tag
[general]

# Display the autocomplete list as you type (default: True).
# When this is off, you can hit tab to see the suggestions.
# auto_display_list = True

# Syntax highlighting as you type (default: True).
# syntax = True

# Display the arg spec (list of arguments) for callables,
# when possible (default: True).
# arg_spec = True

# History file (default: ~/.pythonhist):
# hist_file = ~/.pythonhist

# Number of lines to store in history (set to 0 to disable) (default: 100):
# hist_length = 100

# Soft tab size (default: 4, see pep-8):
# tab_length = 4

# Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
# $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
# to "default" to use the default theme
# color_scheme = default

# External editor to use for editing the current line, block, or full history
# Examples: vi (vim)
#          code --wait (VS Code) - in VS Code use the command palette to:
#                Shell Command: Install 'code' command in PATH
#          atom -nw (Atom)
# Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment
# the line below that will take precedence
# editor = vi

# Whether to append .py to the filename while saving session to a file.
# (default: False)
# save_append_py = False

# The name of a helper executable that should perform pastebin upload on
# bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
#pastebin_helper = gist.py

# How long an undo must be expected to take before prompting for how
# many lines should be undone. Set to -1 to never prompt, or 0 to
# always prompt.
# single_undo_time = 1.0

# Enable autoreload feature by default (default: False).
# default_autoreload = False
# Enable autocompletion of brackets and quotes (default: False)
# brackets_completion = False

[keyboard]

# All key bindings are shown commented out with their default binding

# pastebin = F8
# last_output = F9
# reimport = F6
# help = F1
# toggle_file_watch = F5
# save = C-s
# undo = C-r
# redo = C-g
# up_one_line = C-p
# down_one_line = C-n
# cut_to_buffer = C-k
# search = C-o
# yank_from_buffer = C-y
# backspace = C-h
# clear_word = C-w
# clear_line = C-u
# clear_screen = C-l
# show_source = F2
# exit = C-d
# external_editor = F7
# edit_config = F3
# reverse_incremental_search = M-r
# incremental_search = M-s

[curtsies]

# Allow the the completion and docstring box above the current line
# (default: False)
# list_above = False

# Enables two fish (the shell) style features:
# Previous line key will search for the current line (like reverse incremental
# search) and right arrow will complete the current line with the first match
# from history. (default: True)
# right_arrow_completion = True
heads up bestie: literally every single line in there is commented out πŸ™ˆ so the file as-shown changes nothing β€” uncomment the ones you actually want and bpython will read them. also: these live under section tags ([general], [keyboard], [curtsies]) so keep the tags with their options, okay? πŸ’…

🌸 the [general] girlies 🌸

  • auto_display_list β€” display the autocomplete list as you type. default: True. when this is off, you can hit tab to see the suggestions.
  • syntax β€” syntax highlighting as you type. default: True.
  • arg_spec β€” display the arg spec (list of arguments) for callables, when possible. default: True.
  • hist_file β€” history file. default: ~/.pythonhist.
  • hist_length β€” number of lines to store in history β€” set it to 0 to disable. default: 100.
  • tab_length β€” soft tab size. default: 4, see pep-8.
  • color_scheme β€” color schemes should be put in $XDG_CONFIG_HOME/bpython/. so like, to use the theme $XDG_CONFIG_HOME/bpython/foo.theme, you set color_scheme = foo. leave it blank or set it to "default" to use the default theme πŸ’–
  • editor β€” external editor to use for editing the current line, block, or full history. examples: vi (vim), code --wait (VS Code) β€” and in VS Code use the command palette to: Shell Command: Install 'code' command in PATH β€” and atom -nw (Atom). default: it tries $EDITOR and $VISUAL, then vi β€” but if you uncomment the line below that one, that takes precedence πŸ‘‘
  • save_append_py β€” whether to append .py to the filename while saving session to a file. default: False.
  • pastebin_helper β€” the name of a helper executable that should perform pastebin upload on bpython's behalf. if unset, bpython uploads pastes to bpaste.net. default: empty. example in the sample: gist.py ✨
  • single_undo_time β€” how long an undo must be expected to take before prompting for how many lines should be undone. set it to -1 to never prompt, or 0 to always prompt. the sample shows 1.0.
  • default_autoreload β€” enable autoreload feature by default. default: False.
  • brackets_completion β€” enable autocompletion of brackets and quotes. default: False.

πŸ¦‹ the [keyboard] girlies πŸ¦‹

not me re-showing these β€” but they are part of the sample, and all key bindings are shown commented out with their default binding:

  • pastebin β€” F8
  • last_output β€” F9
  • reimport β€” F6
  • help β€” F1
  • toggle_file_watch β€” F5
  • save β€” C-s
  • undo β€” C-r
  • redo β€” C-g
  • up_one_line β€” C-p
  • down_one_line β€” C-n
  • cut_to_buffer β€” C-k
  • search β€” C-o
  • yank_from_buffer β€” C-y
  • backspace β€” C-h
  • clear_word β€” C-w
  • clear_line β€” C-u
  • clear_screen β€” C-l
  • show_source β€” F2
  • exit β€” C-d
  • external_editor β€” F7
  • edit_config β€” F3
  • reverse_incremental_search β€” M-r
  • incremental_search β€” M-s

πŸ’œ the [curtsies] girlies πŸ’œ

  • list_above β€” allow the the completion and docstring box above the current line. default: False.
  • right_arrow_completion β€” enables two fish (the shell) style features: the Previous line key will search for the current line (like reverse incremental search), and right arrow will complete the current line with the first match from history. default: True.

πŸ‘‘ AUTHOR πŸ‘‘

bpython was written by Robert Anthony Farrell (robertanthonyfarrel@gmail.com) and his bunch of loyal followers 🫢

this manual page was written by JΓΈrgen Pedersen TjernΓΈ (jorgen@devsoft.no), for the Debian project β€” but it may be used by others πŸ’…


2008-2022 Bob Farrell, Andreas Stuehrk, Sebastian Ramacher, Thomas Ballinger, et al.


and that's the whole page bestie, you made it to the end, ate and left no crumbs πŸ“βœ¨ go write your config. this was the BPYTHON-CONFIG(5) page, dated Mar 26, 2026 β€” periodt πŸ’–

πŸ“¦ where this page comes from