1BPYTHON-CONFIG(5) 0.22.1"" BPYTHON-CONFIG(5)
2
3
4
6 bpython-config - user configuration file for bpython
7
9 $XDG_CONFIG_HOME/bpython/config
10
12 The configuration file contains various options controlling the behav‐
13 iour of bpython.
14
16 This refers to the [general] section in your $XDG_CON‐
17 FIG_HOME/bpython/config file.
18
19 arg_spec
20 Display the arg spec (list of arguments) for callables, when possible
21 (default: True).
22
23 auto_display_list
24 Display the autocomplete list as you type (default: True). When this
25 is off, you can hit tab to see the suggestions.
26
27 autocomplete_mode
28 There are four modes for autocomplete: none, simple, substring, and
29 fuzzy. Simple matches methods with a common prefix, substring matches
30 methods with a common subsequence, and fuzzy matches methods with com‐
31 mon characters (default: simple). None disables autocompletion.
32
33 New in version 0.12.
34
35
36 color_scheme
37 See themes for more information.
38
39 Color schemes should be put in $XDG_CONFIG_HOME/bpython/. For example,
40 to use the theme $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme =
41 foo
42
43 Leave blank or set to "default" to use the default (builtin) theme.
44
45 complete_magic_methods
46 Whether magic methods should be auto completed (default: True).
47
48 dedent_after
49 Number of blank lines required before next line will be dedented (de‐
50 fault: 1). If set to 0, automatic dedenting never occurs.
51
52 editor
53 Editor for externally editing the current line, session, or config
54 file.
55
56 New in version 0.13.
57
58
59 flush_output
60 Whether to flush all output to stdout on exit (default: True).
61
62 Only relevant to bpython-curses and bpython-urwid.
63
64 highlight_show_source
65 Whether the source code of an object should be syntax highlighted (de‐
66 fault: True).
67
68 hist_duplicates
69 Whether to store duplicate entries in the history (default: True).
70
71 hist_file
72 History file (default: ~/.pythonhist).
73
74 hist_length
75 Number of lines to store in history (set to 0 to disable) (default:
76 100).
77
78 paste_time
79 The time between keypresses before pastemode is deactivated in
80 bpython-curses (default: 0.02).
81
82 pastebin_confirm
83 Whether pasting to a pastebin needs to be confirmed before sending the
84 data (default: True).
85
86 pastebin_expiry
87 Time duration after which a paste should expire. Valid values are 1day,
88 1week and 1month (default: 1week).
89
90 New in version 0.14.
91
92
93 pastebin_helper
94 The name of a helper executable that should perform pastebin upload on
95 bpython's behalf. If set, this overrides pastebin_url. The helper is
96 expected to return the full URL to the pastebin as the first word of
97 its output. The data is supplied to the helper via STDIN.
98
99 An example helper program is pastebinit, available for most systems.
100 The following helper program can be used to create gists:
101
102 #!/usr/bin/env python
103
104 import sys
105 import requests
106 import json
107
108 def do_gist_json(s):
109 """ Use json to post to github. """
110 gist_public = False
111 gist_url = "https://api.github.com/gists"
112
113 data = {
114 "description": "Gist from bpython",
115 "public": gist_public,
116 "files": {
117 "sample": {
118 "content": s
119 },
120 },
121 }
122
123 headers = {
124 "Content-Type": "application/json",
125 "X-Github-Username": "YOUR_USERNAME",
126 "Authorization": "token YOUR_TOKEN",
127 }
128
129 try:
130 res = requests.post(gist_url, data=json.dumps(payload), headers=headers)
131 res.raise_for_status()
132 json_res = json.loads(res.read())
133 return json_res["html_url"]
134 except requests.exceptions.HTTPError as err:
135 return err
136
137
138 if __name__ == "__main__":
139 s = sys.stdin.read()
140 print(do_gist_json(s))
141
142 New in version 0.12.
143
144
145 pastebin_url
146 The pastebin url to post to (without a trailing slash). This pastebin
147 has to be a pastebin which provides a similar interface to bpaste.net's
148 JSON interface (default: https://bpaste.net).
149
150 save_append_py
151 Whether to append .py to the filename while saving the input to a file.
152
153 New in version 0.13.
154
155
156 single_undo_time
157 Time duration an undo must be predicted to take before prompting to
158 undo multiple lines at once. Use -1 to never prompt, or 0 to always
159 prompt. (default: 1.0)
160
161 New in version 0.14.
162
163
164 syntax
165 Syntax highlighting as you type (default: True).
166
167 tab_length
168 Soft tab size (default 4, see PEP-8).
169
170 unicode_box
171 Whether to use Unicode characters to draw boxes.
172
173 New in version 0.14.
174
175
176 import_completion_skiplist
177 A :-seperated list of patterns to skip when processing modules for im‐
178 port completion.
179
180 New in version 0.21.
181
182
184 This section refers to the [keyboard] section in your $XDG_CON‐
185 FIG_HOME/bpython/config.
186
187 You can set various keyboard shortcuts to be used by bpython. However,
188 we have yet to map all keys to their respective control codes. If you
189 configure a key combination which is not yet supported by bpython it
190 will raise an exception telling you the key does not exist in
191 bpython.keys.
192
193 Valid keys are:
194
195 • Control + any alphanumeric character (C-a through C-z, also a few
196 others).
197
198 • Any function key ranging from F1 to F12.
199
200 backspace
201 Default: C-h
202
203 Delete character in front of the cursor.
204
205 New in version 0.14.
206
207
208 beginning_of_line
209 Default: C-a
210
211 Move to the beginning of the line.
212
213 New in version 0.14.
214
215
216 clear_line
217 Default: C-u
218
219 Clears to the beginning of the line.
220
221 clear_screen
222 Default: C-l
223
224 Clears the screen to the top.
225
226 clear_word
227 Default: C-w
228
229 Clear the word the cursor is currently on.
230
231 copy_clipboard
232 Default: F10
233
234 Copy the entire session to clipboard.
235
236 New in version 0.14.
237
238
239 cut_to_buffer
240 Default: C-k
241
242 Cuts the current line to the buffer.
243
244 delete
245 Default: C-d
246
247 Delete character under the cursor.
248
249 down_one_line
250 Default: C-n
251
252 Move the cursor down, by one line.
253
254 edit_config
255 Default: F3
256
257 Edit bpython configuration in external editor.
258
259 New in version 0.14.
260
261
262 edit_current_block
263 Default: C-x
264
265 Edit current block in external editor.
266
267 New in version 0.14.
268
269
270 end_of_line
271 Default: C-e
272
273 Move to the of the line.
274
275 New in version 0.14.
276
277
278 exit
279 Default: C-d
280
281 Exits bpython (use on empty line)
282
283 external_editor
284 Default: F7
285
286 Edit the entire session in an external editor.
287
288 New in version 0.13.
289
290
291 help
292 Default: F1
293
294 Brings up sincerely cheerful description of bpython features and cur‐
295 rent key bindings.
296
297 New in version 0.14.
298
299
300 incremental_search
301 Default: M-s
302
303 Perform incremental search on all stored lines in the history.
304
305 New in version 0.15.
306
307
308 last_output
309 Default: F9
310
311 Shows the last output in the systems $PAGER. Only works in
312 bpython-curses.
313
314 left
315 Default: C-b
316
317 Move a character to the left.
318
319 New in version 0.14.
320
321
322 pastebin
323 Default: F8
324
325 reimport
326 Default: F6
327
328 Reruns entire session, reloading all modules by clearing the sys.mod‐
329 ules cache.
330
331 New in version 0.14.
332
333
334 reverse_incremental_search
335 Default: M-r
336
337 Perform reverse incremental search on all stored lines in the history.
338
339 New in version 0.15.
340
341
342 right
343 Default: C-f
344
345 Move a character to the right.
346
347 New in version 0.14.
348
349
350 save
351 Default: C-s
352
353 Saves the current session to a file (prompts for filename)
354
355 search
356 Default: C-o
357
358 Search up for any lines containing what is on the current line.
359
360 show_source
361 Default: F2
362
363 Shows the source of the currently being completed (python) function.
364
365 toggle_file_watch
366 Default: F5
367
368 Toggles file watching behaviour; re-runs entire bpython session when‐
369 ever an imported module is modified.
370
371 New in version 0.14.
372
373
374 transpose_chars
375 Default: C-t
376
377 Transpose current character with the one left of it.
378
379 New in version 0.14.
380
381
382 undo
383 Default: C-r
384
385 Rewinds the last action.
386
387 up_one_line
388 Default: C-p
389
390 Move the cursor up, by one line.
391
392 yank_from_buffer
393 Default: C-y
394
395 Pastes the current line from the buffer (the one you previously cut)
396
398 This refers to the [cli] section in your config file.
399
400 suggestion_width
401 Default: 0.8
402
403 The width of the suggestion window in percent of the terminal width.
404
405 New in version 0.9.8.
406
407
408 trim_prompts
409 Default: False
410
411 Trims lines starting with '>>> ' when set to True.
412
414 This refers to the [curtsies] section in your config file.
415
416 New in version 0.13.
417
418
419 list_above
420 Default: False
421
422 When there is space above the current line, whether the suggestions
423 list will be displayed there instead of below the current line.
424
425 right_arrow_completion
426 Default: True
427
428 Full line suggestion and completion (like fish shell and many web
429 browsers).
430
431 Full line completions are displayed under the cursor in gray. When the
432 cursor is at the end of a line, pressing right arrow or ctrl-f will
433 complete the full line. This option also turns on substring history
434 search, highlighting the matching section in previous result.
435
437 # This is a standard Python config file.
438 # Valid values can be True, False, integer numbers, and strings.
439 # Lines starting with # are treated as comments.
440 #
441 # By default bpython will look for $XDG_CONFIG_HOME/bpython/config
442 # ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
443 # --config option on the command line.
444 #
445 # See http://docs.bpython-interpreter.org/configuration.html for all
446 # configurable options.
447
448 # General section tag
449 [general]
450
451 # Display the autocomplete list as you type (default: True).
452 # When this is off, you can hit tab to see the suggestions.
453 # auto_display_list = True
454
455 # Syntax highlighting as you type (default: True).
456 # syntax = True
457
458 # Display the arg spec (list of arguments) for callables,
459 # when possible (default: True).
460 # arg_spec = True
461
462 # History file (default: ~/.pythonhist):
463 # hist_file = ~/.pythonhist
464
465 # Number of lines to store in history (set to 0 to disable) (default: 100):
466 # hist_length = 100
467
468 # Soft tab size (default: 4, see pep-8):
469 # tab_length = 4
470
471 # Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
472 # $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
473 # to "default" to use the default theme
474 # color_scheme = default
475
476 # External editor to use for editing the current line, block, or full history
477 # Examples: vi (vim)
478 # code --wait (VS Code) - in VS Code use the command palette to:
479 # Shell Command: Install 'code' command in PATH
480 # atom -nw (Atom)
481 # Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment
482 # the line below that will take precedence
483 # editor = vi
484
485 # Whether to append .py to the filename while saving session to a file.
486 # (default: False)
487 # save_append_py = False
488
489 # The name of a helper executable that should perform pastebin upload on
490 # bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
491 #pastebin_helper = gist.py
492
493 # How long an undo must be expected to take before prompting for how
494 # many lines should be undone. Set to -1 to never prompt, or 0 to
495 # always prompt.
496 # single_undo_time = 1.0
497
498 # Enable autoreload feature by default (default: False).
499 # default_autoreload = False
500
501 [keyboard]
502
503 # All key bindings are shown commented out with their default binding
504
505 # pastebin = F8
506 # last_output = F9
507 # reimport = F6
508 # help = F1
509 # toggle_file_watch = F5
510 # save = C-s
511 # undo = C-r
512 # redo = C-g
513 # up_one_line = C-p
514 # down_one_line = C-n
515 # cut_to_buffer = C-k
516 # search = C-o
517 # yank_from_buffer = C-y
518 # backspace = C-h
519 # clear_word = C-w
520 # clear_line = C-u
521 # clear_screen = C-l
522 # show_source = F2
523 # exit = C-d
524 # external_editor = F7
525 # edit_config = F3
526 # reverse_incremental_search = M-r
527 # incremental_search = M-s
528
529 [curtsies]
530
531 # Allow the the completion and docstring box above the current line
532 # (default: False)
533 # list_above = False
534
535 # Enables two fish (the shell) style features:
536 # Previous line key will search for the current line (like reverse incremental
537 # search) and right arrow will complete the current line with the first match
538 # from history. (default: True)
539 # right_arrow_completion = True
540
541
543 bpython was written by Robert Anthony Farrell <‐
544 robertanthonyfarrel@gmail.com> and his bunch of loyal followers.
545
546 This manual page was written by Jørgen Pedersen Tjernø <‐
547 jorgen@devsoft.no>, for the Debian project (but may be used by others).
548
550 2008-2021 Bob Farrell, Andreas Stuehrk, Sebastian Ramacher, Thomas
551 Ballinger, et al.
552
553
554
555
556 Nov 10, 2021 BPYTHON-CONFIG(5)