Configuration

You can copy the supplied sample-config to your home directory and move it to /.bpython/config. bpython tries to find ~/.bpython/config and use it as its configuration (it also looks for ~/.bpython.ini as this was the default before 0.9.4), if the file does not exist bpython will use its documented defaults.

General

This refers to the [general] section in your ~/.bpython/config file.

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).

paste_time

The time between lines before pastemode is activated in seconds (default: 0.02).

hist_len

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

tab_length

Soft tab size (default 4, see pep-8)

pastebin_url

The pastebin url to post to (without a trailing slash). This pastebin has to be a pastebin which uses LodgeIt. Examples are: http://paste.pocoo.org/xmlrpc/ and http://bpaste.net/xmlrpc/ (default: http://bpaste.net/xmlrpc/)

pastebin_show_url

The url under which the new paste can be reached. $paste_id will be replaced by the ID of the new paste. Examples are: http://bpaste.net/show/$paste_id/ and http://paste.pocoo.org/show/$paste_id/ (default: http://bpaste.net/show/$paste_id/)

color_scheme

See Themes for more information.

Color schemes should be put in ~/.bpython/

e.g to use the theme ~/.bpython/foo.theme set color_scheme = foo

If you set the colorscheme to foo this will be translated to ~/.bpython/foo.theme so be sure to put the file in that directory.

Leave blank or set to “default” to use the default (builtin) theme.

flush_output

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

Keyboard

This section refers to the [keyboard] section in your ~/.bpython/config.

You can set various keyboard shortcuts to be used by bpython. However, we have yet to map all keys to their respective control codes. If you configure a key combination which is not yet supported by bpython it will raise an exception telling you the key does not exist in bpython.keys.

Valid keys are:

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

pastebin

Default: <F8>

last_output

Default: F9

Shows the last output in the systems $PAGER.

save

Default: C-s

Saves the current session to a file (prompts for filename)

undo

Default: C-r

Rewinds the last action.

up_one_line

Default: C-p

Move the cursor up, by one line.

down_one_line

Default: C-n

Move the cursor down, by one line.

cut_to_buffer

Default: C-k

Cuts the current line to the buffer.

yank_from_buffer

Default: C-y

Pastes the current line from the buffer (the one you previously cutted)

clear_word

Default: C-w

Clear the word the cursor is currently on.

clear_line

Default: C-u

Clears to the beginning of the line.

clear_screen

Default: C-l

Clears the screen to the top.

exit

Default: C-d

Exits bpython (use on empty line)

GTK

This refers to the [gtk] section in your ~/.bpython/config file.

font

Default: Monospace 10

The font to be used by the GTK version.