1BPYTHON-CONFIG(5) bpython 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 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. The helper is
99 expected to return the full URL to the pastebin as the first word of
100 its output. The data is supplied to the helper via STDIN.
101
102 An example helper program is pastebinit, available for most systems.
103 The following helper program can be used to create gists:
104
105 #!/usr/bin/env python
106
107 import sys
108 import urllib2
109 import json
110
111 def do_gist_json(s):
112 """ Use json to post to github. """
113 gist_public = False
114 gist_url = 'https://api.github.com/gists'
115
116 data = {'description': None,
117 'public': None,
118 'files' : {
119 'sample': { 'content': None }
120 }}
121 data['description'] = 'Gist from BPython'
122 data['public'] = gist_public
123 data['files']['sample']['content'] = s
124
125 req = urllib2.Request(gist_url, json.dumps(data), {'Content-Type': 'application/json'})
126 try:
127 res = urllib2.urlopen(req)
128 except HTTPError, e:
129 return e
130
131 try:
132 json_res = json.loads(res.read())
133 return json_res['html_url']
134 except HTTPError, e:
135 return e
136
137 if __name__ == "__main__":
138 s = sys.stdin.read()
139 print do_gist_json(s)
140
141 New in version 0.12.
142
143
144 pastebin_url
145 The pastebin url to post to (without a trailing slash). This pastebin
146 has to be a pastebin which provides a similar interface to bpaste.net's
147 JSON interface (default: https://bpaste.net).
148
149 save_append_py
150 Whether to append .py to the filename while saving the input to a file.
151
152 New in version 0.13.
153
154
155 single_undo_time
156 Time duration an undo must be predicted to take before prompting to
157 undo multiple lines at once. Use -1 to never prompt, or 0 to always
158 prompt. (default: 1.0)
159
160 New in version 0.14.
161
162
163 syntax
164 Syntax highlighting as you type (default: True).
165
166 tab_length
167 Soft tab size (default 4, see PEP-8).
168
169 unicode_box
170 Whether to use Unicode characters to draw boxes.
171
172 New in version 0.14.
173
174
176 This section refers to the [keyboard] section in your $XDG_CON‐
177 FIG_HOME/bpython/config.
178
179 You can set various keyboard shortcuts to be used by bpython. However,
180 we have yet to map all keys to their respective control codes. If you
181 configure a key combination which is not yet supported by bpython it
182 will raise an exception telling you the key does not exist in
183 bpython.keys.
184
185 Valid keys are:
186
187 · Control + any alphanumeric character (C-a through C-z, also a few
188 others).
189
190 · Any function key ranging from F1 to F12.
191
192 backspace
193 Default: C-h
194
195 Delete character in front of the cursor.
196
197 New in version 0.14.
198
199
200 beginning_of_line
201 Default: C-a
202
203 Move to the beginning of the line.
204
205 New in version 0.14.
206
207
208 clear_line
209 Default: C-u
210
211 Clears to the beginning of the line.
212
213 clear_screen
214 Default: C-l
215
216 Clears the screen to the top.
217
218 clear_word
219 Default: C-w
220
221 Clear the word the cursor is currently on.
222
223 copy_clipboard
224 Default: F10
225
226 Copy the entire session to clipboard.
227
228 New in version 0.14.
229
230
231 cut_to_buffer
232 Default: C-k
233
234 Cuts the current line to the buffer.
235
236 delete
237 Default: C-d
238
239 Delete character under the cursor.
240
241 down_one_line
242 Default: C-n
243
244 Move the cursor down, by one line.
245
246 edit_config
247 Default: F3
248
249 Edit bpython configuration in external editor.
250
251 New in version 0.14.
252
253
254 edit_current_block
255 Default: C-x
256
257 Edit current block in external editor.
258
259 New in version 0.14.
260
261
262 end_of_line
263 Default: C-e
264
265 Move to the of the line.
266
267 New in version 0.14.
268
269
270 exit
271 Default: C-d
272
273 Exits bpython (use on empty line)
274
275 external_editor
276 Default: F7
277
278 Edit the entire session in an external editor.
279
280 New in version 0.13.
281
282
283 help
284 Default: F1
285
286 Brings up sincerely cheerful description of bpython features and cur‐
287 rent key bindings.
288
289 New in version 0.14.
290
291
292 incremental_search
293 Default: M-s
294
295 Perform incremental search on all stored lines in the history.
296
297 New in version 0.15.
298
299
300 last_output
301 Default: F9
302
303 Shows the last output in the systems $PAGER. Only works in
304 bpython-curses.
305
306 left
307 Default: C-b
308
309 Move a character to the left.
310
311 New in version 0.14.
312
313
314 pastebin
315 Default: F8
316
317 reimport
318 Default: F6
319
320 Reruns entire session, reloading all modules by clearing the sys.mod‐
321 ules cache.
322
323 New in version 0.14.
324
325
326 reverse_incremental_search
327 Default: M-r
328
329 Perform reverse incremental search on all stored lines in the history.
330
331 New in version 0.15.
332
333
334 right
335 Default: C-f
336
337 Move a character to the right.
338
339 New in version 0.14.
340
341
342 save
343 Default: C-s
344
345 Saves the current session to a file (prompts for filename)
346
347 search
348 Default: C-o
349
350 Search up for any lines containing what is on the current line.
351
352 show_source
353 Default: F2
354
355 Shows the source of the currently being completed (python) function.
356
357 toggle_file_watch
358 Default: F5
359
360 Toggles file watching behaviour; re-runs entire bpython session when‐
361 ever an imported module is modified.
362
363 New in version 0.14.
364
365
366 transpose_chars
367 Default: C-t
368
369 Transpose current character with the one left of it.
370
371 New in version 0.14.
372
373
374 undo
375 Default: C-r
376
377 Rewinds the last action.
378
379 up_one_line
380 Default: C-p
381
382 Move the cursor up, by one line.
383
384 yank_from_buffer
385 Default: C-y
386
387 Pastes the current line from the buffer (the one you previously cutted)
388
390 This refers to the [cli] section in your config file.
391
392 suggestion_width
393 Default: 0.8
394
395 The width of the suggestion window in percent of the terminal width.
396
397 New in version 0.9.8.
398
399
400 trim_prompts
401 Default: False
402
403 Trims lines starting with '>>> ' when set to True.
404
406 This refers to the [curtsies] section in your config file.
407
408 New in version 0.13.
409
410
411 list_above
412 Default: False
413
414 When there is space above the current line, whether the suggestions
415 list will be displayed there instead of below the current line.
416
417 right_arrow_completion
418 Default: True
419
420 Full line suggestion and completion (like fish shell and many web
421 browsers).
422
423 Full line completions are displayed under the cursor in gray. When the
424 cursor is at the end of a line, pressing right arrow or ctrl-f will
425 complete the full line. This option also turns on substring history
426 search, highlighting the matching section in previous result.
427
429 # This is a standard python config file
430 # Valid values can be True, False, integer numbers, strings
431 # By default bpython will look for $XDG_CONFIG_HOME/bpython/config
432 # ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
433 # --config option on the command line
434 #
435 # see http://docs.bpython-interpreter.org/configuration.html
436 # for all configurable options
437
438 # General section tag
439 [general]
440
441 # Display the autocomplete list as you type (default: True).
442 # When this is off, you can hit tab to see the suggestions.
443 # auto_display_list = True
444
445 # Syntax highlighting as you type (default: True).
446 # syntax = True
447
448 # Display the arg spec (list of arguments) for callables,
449 # when possible (default: True).
450 # arg_spec = True
451
452 # History file (default: ~/.pythonhist):
453 # hist_file = ~/.pythonhist
454
455 # Number of lines to store in history (set to 0 to disable) (default: 100):
456 # hist_length = 100
457
458 # Soft tab size (default: 4, see pep-8):
459 # tab_length = 4
460
461 # Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
462 # $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
463 # to "default" to use the default theme
464 # color_scheme = default
465
466 # External editor to use for editing the current line, block, or full history
467 # Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment
468 # the line below that will take precedence
469 # editor = vi
470
471 # Whether to append .py to the filename while saving session to a file.
472 # (default: False)
473 # save_append_py = False
474
475 # The name of a helper executable that should perform pastebin upload on
476 # bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
477 #pastebin_helper = gist.py
478
479 # How long an undo must be expected to take before prompting for how
480 # many lines should be undone. Set to -1 to never prompt, or 0 to
481 # always prompt.
482 # single_undo_time = 1.0
483
484 # Enable autoreload feature by default (default: False).
485 # default_autoreload = False
486
487 [keyboard]
488
489 # All key bindings are shown commented out with their default binding
490
491 # pastebin = F8
492 # last_output = F9
493 # reimport = F6
494 # help = F1
495 # toggle_file_watch = F5
496 # save = C-s
497 # undo = C-r
498 # up_one_line = C-p
499 # down_one_line = C-n
500 # cut_to_buffer = C-k
501 # search = C-o
502 # yank_from_buffer = C-y
503 # backspace = C-h
504 # clear_word = C-w
505 # clear_line = C-u
506 # clear_screen = C-l
507 # show_source = F2
508 # exit = C-d
509 # external_editor = F7
510 # edit_config = F3
511 # reverse_incremental_search = M-r
512 # incremental_search = M-s
513
514 [curtsies]
515
516 # Allow the the completion and docstring box above the current line
517 # (default: False)
518 # list_above = False
519
520 # Enables two fish (the shell) style features:
521 # Previous line key will search for the current line (like reverse incremental
522 # search) and right arrow will complete the current line with the first match
523 # from history. (default: True)
524 # right_arrow_completion = True
525
526
528 bpython was written by Robert Anthony Farrell <‐
529 robertanthonyfarrel@gmail.com> and his bunch of loyal followers.
530
531 This manual page was written by Jørgen Pedersen Tjernø <‐
532 jorgen@devsoft.no>, for the Debian project (but may be used by others).
533
535 2008-2020 Bob Farrell, Andreas Stuehrk et al.
536
537
538
539
540 unknown Apr 18, 2020 BPYTHON-CONFIG(5)