1BPYTHON-CONFIG(5)                   bpython                  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  three modes for autocomplete. simple, substring, and fuzzy.
29       Simple matches methods with a common prefix, substring matches  methods
30       with  a common subsequence, and fuzzy matches methods with common char‐
31       acters (default: simple).
32
33       As of version 0.14 this option has no effect, but is reserved for later
34       use.
35
36       New in version 0.12.
37
38
39   color_scheme
40       See themes for more information.
41
42       Color  schemes should be put in $XDG_CONFIG_HOME/bpython/. For example,
43       to use the theme $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme  =
44       foo
45
46       Leave blank or set to "default" to use the default (builtin) theme.
47
48   complete_magic_methods
49       Whether magic methods should be auto completed (default: True).
50
51   dedent_after
52       Number  of  blank  lines  required  before  next  line will be dedented
53       (default: 1).  If set to 0, automatic dedenting never occurs.
54
55   editor
56       Editor for externally editing the  current  line,  session,  or  config
57       file.
58
59       New in version 0.13.
60
61
62   flush_output
63       Whether to flush all output to stdout on exit (default: True).
64
65       Only relevant to bpython-curses and bpython-urwid.
66
67   highlight_show_source
68       Whether  the  source  code  of  an  object should be syntax highlighted
69       (default: True).
70
71   hist_duplicates
72       Whether to store duplicate entries in the history (default: True).
73
74   hist_file
75       History file (default: ~/.pythonhist).
76
77   hist_length
78       Number of lines to store in history (set to  0  to  disable)  (default:
79       100).
80
81   paste_time
82       The   time  between  keypresses  before  pastemode  is  deactivated  in
83       bpython-curses (default: 0.02).
84
85   pastebin_confirm
86       Whether pasting to a pastebin needs to be confirmed before sending  the
87       data (default: True).
88
89   pastebin_expiry
90       Time duration after which a paste should expire. Valid values are 1day,
91       1week and 1month (default: 1week).
92
93       New in version 0.14.
94
95
96   pastebin_helper
97       The name of a helper executable that should perform pastebin upload  on
98       bpython's  behalf.  If  set, this overrides pastebin_url. It also over‐
99       rides pastebin_show_url, as the helper is expected to return  the  full
100       URL  to  the pastebin as the first word of its output. The data is sup‐
101       plied to the helper via STDIN.
102
103       An example helper program is pastebinit, available  for  most  systems.
104       The following helper program can be used to create gists:
105
106          #!/usr/bin/env python
107
108          import sys
109          import urllib2
110          import json
111
112          def do_gist_json(s):
113              """ Use json to post to github. """
114              gist_public = False
115              gist_url = 'https://api.github.com/gists'
116
117              data = {'description': None,
118                      'public': None,
119                      'files' : {
120                          'sample': { 'content': None }
121                      }}
122              data['description'] = 'Gist from BPython'
123              data['public'] = gist_public
124              data['files']['sample']['content'] = s
125
126              req = urllib2.Request(gist_url, json.dumps(data), {'Content-Type': 'application/json'})
127              try:
128                  res = urllib2.urlopen(req)
129              except HTTPError, e:
130                  return e
131
132              try:
133                  json_res = json.loads(res.read())
134                  return json_res['html_url']
135              except HTTPError, e:
136                  return e
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_show_url
146       The  url  under  which  the new paste can be reached. $paste_id will be
147       replaced    by    the    ID    of    the    new     paste     (default:
148       https://bpaste.net/show/$paste_id/).
149
150   pastebin_removal_url
151       The  url  under  which  a  paste  can  be  removed. $removal_id will be
152       replaced   by   the    removal    ID    of    the    paste    (default:
153       https://bpaste.net/remova/$removal_id/).
154
155       New in version 0.14.
156
157
158   pastebin_url
159       The  pastebin  url to post to (without a trailing slash). This pastebin
160       has to be a  pastebin  which  uses  provides  a  similar  interface  to
161       bpaste.net's JSON interface (default: https://bpaste.net/json/new).
162
163   save_append_py
164       Whether to append .py to the filename while saving the input to a file.
165
166       New in version 0.13.
167
168
169   single_undo_time
170       Time  duration  an  undo  must be predicted to take before prompting to
171       undo multiple lines at once. Use -1 to never prompt,  or  0  to  always
172       prompt.  (default: 1.0)
173
174       New in version 0.14.
175
176
177   syntax
178       Syntax highlighting as you type (default: True).
179
180   tab_length
181       Soft tab size (default 4, see PEP-8).
182
183   unicode_box
184       Whether to use Unicode characters to draw boxes.
185
186       New in version 0.14.
187
188

KEYBOARD

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

CLI

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

CURTSIES

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

SAMPLE CONFIG

443          # This is a standard python config file
444          # Valid values can be True, False, integer numbers, strings
445          # By default bpython will look for $XDG_CONFIG_HOME/bpython/config
446          # ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
447          # --config option on the command line
448          #
449          # see http://docs.bpython-interpreter.org/configuration.html
450          # for all configurable options
451
452          # General section tag
453          [general]
454
455          # Display the autocomplete list as you type (default: True).
456          # When this is off, you can hit tab to see the suggestions.
457          # auto_display_list = True
458
459          # Syntax highlighting as you type (default: True).
460          # syntax = True
461
462          # Display the arg spec (list of arguments) for callables,
463          # when possible (default: True).
464          # arg_spec = True
465
466          # History file (default: ~/.pythonhist):
467          # hist_file = ~/.pythonhist
468
469          # Number of lines to store in history (set to 0 to disable) (default: 100):
470          # hist_length = 100
471
472          # Soft tab size (default: 4, see pep-8):
473          # tab_length = 4
474
475          # Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
476          # $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
477          # to "default" to use the default theme
478          # color_scheme = default
479
480          # External editor to use for editing the current line, block, or full history
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          # up_one_line = C-p
513          # down_one_line = C-n
514          # cut_to_buffer = C-k
515          # search = C-o
516          # yank_from_buffer = C-y
517          # backspace = C-h
518          # clear_word = C-w
519          # clear_line = C-u
520          # clear_screen = C-l
521          # show_source = F2
522          # exit = C-d
523          # external_editor = F7
524          # edit_config = F3
525          # reverse_incremental_search = M-r
526          # incremental_search = M-s
527
528          [curtsies]
529
530          # Allow the the completion and docstring box above the current line
531          # (default: False)
532          # list_above = False
533
534          # Enables two fish (the shell) style features:
535          # Previous line key will search for the current line (like reverse incremental
536          # search) and right arrow will complete the current line with the first match
537          # from history. (default: True)
538          # right_arrow_completion = True
539
540

AUTHOR

542       bpython    was    written    by    Robert    Anthony     Farrell     <‐
543       robertanthonyfarrel@gmail.com> and his bunch of loyal followers.
544
545       This   manual   page   was   written   by  Jørgen  Pedersen  Tjernø  <‐
546       jorgen@devsoft.no>, for the Debian project (but may be used by others).
547
549       2008-2019 Bob Farrell, Andreas Stuehrk et al.
550
551
552
553
554 0.18                            Jul 24, 2019                BPYTHON-CONFIG(5)
Impressum