1BPYTHON-CONFIG(5)                   0.24""                   BPYTHON-CONFIG(5)
2
3
4

NAME

6       bpython-config - user configuration file for bpython
7

SYNOPSIS

9       $XDG_CONFIG_HOME/bpython/config
10

DESCRIPTION

12       The  configuration file contains various options controlling the behav‐
13       iour of bpython.
14

GENERAL

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   brackets_completion
37       Whether opening character of the pairs (), [], "",  and  ''  should  be
38       auto-closed (default: False).
39
40       New in version 0.23.
41
42
43   color_scheme
44       See Themes for more information.
45
46       Color  schemes should be put in $XDG_CONFIG_HOME/bpython/. For example,
47       to use the theme $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme  =
48       foo
49
50       Leave blank or set to "default" to use the default (builtin) theme.
51
52   complete_magic_methods
53       Whether magic methods should be auto completed (default: True).
54
55   dedent_after
56       Number  of  blank lines required before next line will be dedented (de‐
57       fault: 1).  If set to 0, automatic dedenting never occurs.
58
59   editor
60       Editor for externally editing the  current  line,  session,  or  config
61       file.
62
63       New in version 0.13.
64
65
66   flush_output
67       Whether to flush all output to stdout on exit (default: True).
68
69       Only relevant to bpython-curses and bpython-urwid.
70
71   highlight_show_source
72       Whether  the source code of an object should be syntax highlighted (de‐
73       fault: True).
74
75   hist_duplicates
76       Whether to store duplicate entries in the history (default: True).
77
78   hist_file
79       History file (default: ~/.pythonhist).
80
81   hist_length
82       Number of lines to store in history (set to  0  to  disable)  (default:
83       100).
84
85   paste_time
86       The   time  between  keypresses  before  pastemode  is  deactivated  in
87       bpython-curses (default: 0.02).
88
89   pastebin_confirm
90       Whether pasting to a pastebin needs to be confirmed before sending  the
91       data (default: True).
92
93   pastebin_expiry
94       Time duration after which a paste should expire. Valid values are 1day,
95       1week and 1month (default: 1week).
96
97       New in version 0.14.
98
99
100   pastebin_helper
101       The name of a helper executable that should perform pastebin upload  on
102       bpython's  behalf.  If  set, this overrides pastebin_url. The helper is
103       expected to return the full URL to the pastebin as the  first  word  of
104       its output. The data is supplied to the helper via STDIN.
105
106       An  example  helper  program is pastebinit, available for most systems.
107       The following helper program can be used to create gists:
108
109          #!/usr/bin/env python
110
111          import sys
112          import requests
113          import json
114
115          def do_gist_json(s):
116              """ Use json to post to github. """
117              gist_public = False
118              gist_url = "https://api.github.com/gists"
119
120              data = {
121                  "description": "Gist from bpython",
122                  "public": gist_public,
123                  "files": {
124                      "sample": {
125                          "content": s
126                      },
127                  },
128              }
129
130              headers = {
131                  "Content-Type": "application/json",
132                  "X-Github-Username": "YOUR_USERNAME",
133                  "Authorization": "token YOUR_TOKEN",
134              }
135
136              try:
137                  res = requests.post(gist_url, data=json.dumps(payload), headers=headers)
138                  res.raise_for_status()
139                  json_res = json.loads(res.read())
140                  return json_res["html_url"]
141              except requests.exceptions.HTTPError as err:
142                  return err
143
144
145          if __name__ == "__main__":
146            s = sys.stdin.read()
147            print(do_gist_json(s))
148
149       New in version 0.12.
150
151
152   pastebin_url
153       The pastebin url to post to (without a trailing slash).  This  pastebin
154       has to be a pastebin which provides a similar interface to bpaste.net's
155       JSON interface (default: https://bpaste.net).
156
157   save_append_py
158       Whether to append .py to the filename while saving the input to a file.
159
160       New in version 0.13.
161
162
163   single_undo_time
164       Time duration an undo must be predicted to  take  before  prompting  to
165       undo  multiple  lines  at  once. Use -1 to never prompt, or 0 to always
166       prompt.  (default: 1.0)
167
168       New in version 0.14.
169
170
171   syntax
172       Syntax highlighting as you type (default: True).
173
174   tab_length
175       Soft tab size (default 4, see PEP-8).
176
177   unicode_box
178       Whether to use Unicode characters to draw boxes (default: True).
179
180       New in version 0.14.
181
182
183   import_completion_skiplist
184       A :-seperated list of patterns to skip when processing modules for  im‐
185       port completion.
186
187       New in version 0.21.
188
189

KEYBOARD

191       This  section  refers  to  the  [keyboard]  section  in  your $XDG_CON‐
192       FIG_HOME/bpython/config.
193
194       You can set various keyboard shortcuts to be used by bpython.  However,
195       we  have  yet to map all keys to their respective control codes. If you
196       configure a key combination which is not yet supported  by  bpython  it
197       will  raise  an  exception  telling  you  the  key  does  not  exist in
198       bpython.keys.
199
200       Valid keys are:
201
202       • Control + any alphanumeric character (C-a through  C-z,  also  a  few
203         others).
204
205       • Any function key ranging from F1 to F12.
206
207   backspace
208       Default: C-h
209
210       Delete character in front of the cursor.
211
212       New in version 0.14.
213
214
215   beginning_of_line
216       Default: C-a
217
218       Move to the beginning of the line.
219
220       New in version 0.14.
221
222
223   clear_line
224       Default: C-u
225
226       Clears to the beginning of the line.
227
228   clear_screen
229       Default: C-l
230
231       Clears the screen to the top.
232
233   clear_word
234       Default: C-w
235
236       Clear the word the cursor is currently on.
237
238   copy_clipboard
239       Default: F10
240
241       Copy the entire session to clipboard.
242
243       New in version 0.14.
244
245
246   cut_to_buffer
247       Default: C-k
248
249       Cuts the current line to the buffer.
250
251   delete
252       Default: C-d
253
254       Delete character under the cursor.
255
256   down_one_line
257       Default: C-n
258
259       Move the cursor down, by one line.
260
261   edit_config
262       Default: F3
263
264       Edit bpython configuration in external editor.
265
266       New in version 0.14.
267
268
269   edit_current_block
270       Default: C-x
271
272       Edit current block in external editor.
273
274       New in version 0.14.
275
276
277   end_of_line
278       Default: C-e
279
280       Move to the of the line.
281
282       New in version 0.14.
283
284
285   exit
286       Default: C-d
287
288       Exits bpython (use on empty line)
289
290   external_editor
291       Default: F7
292
293       Edit the entire session in an external editor.
294
295       New in version 0.13.
296
297
298   help
299       Default: F1
300
301       Brings  up  sincerely cheerful description of bpython features and cur‐
302       rent key bindings.
303
304       New in version 0.14.
305
306
307   incremental_search
308       Default: M-s
309
310       Perform incremental search on all stored lines in the history.
311
312       New in version 0.15.
313
314
315   last_output
316       Default: F9
317
318       Shows  the  last  output  in  the  systems  $PAGER.   Only   works   in
319       bpython-curses.
320
321   left
322       Default: C-b
323
324       Move a character to the left.
325
326       New in version 0.14.
327
328
329   pastebin
330       Default: F8
331
332   reimport
333       Default: F6
334
335       Reruns  entire  session, reloading all modules by clearing the sys.mod‐
336       ules cache.
337
338       New in version 0.14.
339
340
341   reverse_incremental_search
342       Default: M-r
343
344       Perform reverse incremental search on all stored lines in the history.
345
346       New in version 0.15.
347
348
349   right
350       Default: C-f
351
352       Move a character to the right.
353
354       New in version 0.14.
355
356
357   save
358       Default: C-s
359
360       Saves the current session to a file (prompts for filename)
361
362   search
363       Default: C-o
364
365       Search up for any lines containing what is on the current line.
366
367   show_source
368       Default: F2
369
370       Shows the source of the currently being completed (python) function.
371
372   toggle_file_watch
373       Default: F5
374
375       Toggles file watching behaviour; re-runs entire bpython  session  when‐
376       ever an imported module is modified.
377
378       New in version 0.14.
379
380
381   transpose_chars
382       Default: C-t
383
384       Transpose current character with the one left of it.
385
386       New in version 0.14.
387
388
389   undo
390       Default: C-r
391
392       Rewinds the last action.
393
394   up_one_line
395       Default: C-p
396
397       Move the cursor up, by one line.
398
399   yank_from_buffer
400       Default: C-y
401
402       Pastes the current line from the buffer (the one you previously cut)
403

CLI

405       This refers to the [cli] section in your config file.
406
407   suggestion_width
408       Default: 0.8
409
410       The width of the suggestion window in percent of the terminal width.
411
412       New in version 0.9.8.
413
414
415   trim_prompts
416       Default: False
417
418       Trims lines starting with '>>> ' when set to True.
419

CURTSIES

421       This refers to the [curtsies] section in your config file.
422
423       New in version 0.13.
424
425
426   list_above
427       Default: False
428
429       When  there  is  space  above the current line, whether the suggestions
430       list will be displayed there instead of below the current line.
431
432   right_arrow_completion
433       Default: True
434
435       Full line suggestion and completion  (like  fish  shell  and  many  web
436       browsers).
437
438       Full line completions are displayed under the cursor in gray.  When the
439       cursor is at the end of a line, pressing right  arrow  or  ctrl-f  will
440       complete  the  full  line.  This option also turns on substring history
441       search, highlighting the matching section in previous result.
442

SAMPLE CONFIG

444          # This is a standard Python config file.
445          # Valid values can be True, False, integer numbers, and strings.
446          # Lines starting with # are treated as comments.
447          #
448          # By default bpython will look for $XDG_CONFIG_HOME/bpython/config
449          # ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
450          # --config option on the command line.
451          #
452          # See http://docs.bpython-interpreter.org/configuration.html for all
453          # configurable options.
454
455          # General section tag
456          [general]
457
458          # Display the autocomplete list as you type (default: True).
459          # When this is off, you can hit tab to see the suggestions.
460          # auto_display_list = True
461
462          # Syntax highlighting as you type (default: True).
463          # syntax = True
464
465          # Display the arg spec (list of arguments) for callables,
466          # when possible (default: True).
467          # arg_spec = True
468
469          # History file (default: ~/.pythonhist):
470          # hist_file = ~/.pythonhist
471
472          # Number of lines to store in history (set to 0 to disable) (default: 100):
473          # hist_length = 100
474
475          # Soft tab size (default: 4, see pep-8):
476          # tab_length = 4
477
478          # Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
479          # $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
480          # to "default" to use the default theme
481          # color_scheme = default
482
483          # External editor to use for editing the current line, block, or full history
484          # Examples: vi (vim)
485          #          code --wait (VS Code) - in VS Code use the command palette to:
486          #                Shell Command: Install 'code' command in PATH
487          #          atom -nw (Atom)
488          # Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment
489          # the line below that will take precedence
490          # editor = vi
491
492          # Whether to append .py to the filename while saving session to a file.
493          # (default: False)
494          # save_append_py = False
495
496          # The name of a helper executable that should perform pastebin upload on
497          # bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
498          #pastebin_helper = gist.py
499
500          # How long an undo must be expected to take before prompting for how
501          # many lines should be undone. Set to -1 to never prompt, or 0 to
502          # always prompt.
503          # single_undo_time = 1.0
504
505          # Enable autoreload feature by default (default: False).
506          # default_autoreload = False
507          # Enable autocompletion of brackets and quotes (default: False)
508          # brackets_completion = False
509
510          [keyboard]
511
512          # All key bindings are shown commented out with their default binding
513
514          # pastebin = F8
515          # last_output = F9
516          # reimport = F6
517          # help = F1
518          # toggle_file_watch = F5
519          # save = C-s
520          # undo = C-r
521          # redo = C-g
522          # up_one_line = C-p
523          # down_one_line = C-n
524          # cut_to_buffer = C-k
525          # search = C-o
526          # yank_from_buffer = C-y
527          # backspace = C-h
528          # clear_word = C-w
529          # clear_line = C-u
530          # clear_screen = C-l
531          # show_source = F2
532          # exit = C-d
533          # external_editor = F7
534          # edit_config = F3
535          # reverse_incremental_search = M-r
536          # incremental_search = M-s
537
538          [curtsies]
539
540          # Allow the the completion and docstring box above the current line
541          # (default: False)
542          # list_above = False
543
544          # Enables two fish (the shell) style features:
545          # Previous line key will search for the current line (like reverse incremental
546          # search) and right arrow will complete the current line with the first match
547          # from history. (default: True)
548          # right_arrow_completion = True
549
550

AUTHOR

552       bpython    was    written    by    Robert    Anthony     Farrell     <‐
553       robertanthonyfarrel@gmail.com> and his bunch of loyal followers.
554
555       This   manual   page   was   written   by  Jørgen  Pedersen  Tjernø  <‐
556       jorgen@devsoft.no>, for the Debian project (but may be used by others).
557
559       2008-2023 Bob Farrell,  Andreas  Stuehrk,  Sebastian  Ramacher,  Thomas
560       Ballinger, et al.
561
562
563
564
565                                 Jan 15, 2023                BPYTHON-CONFIG(5)
Impressum