1BPYTHON-CONFIG(5) 0.21"" 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
175 import_completion_skiplist
176 A :-seperated list of patterns to skip when processing modules for
177 import completion.
178
179 New in version 0.21.
180
181
183 This section refers to the [keyboard] section in your $XDG_CON‐
184 FIG_HOME/bpython/config.
185
186 You can set various keyboard shortcuts to be used by bpython. However,
187 we have yet to map all keys to their respective control codes. If you
188 configure a key combination which is not yet supported by bpython it
189 will raise an exception telling you the key does not exist in
190 bpython.keys.
191
192 Valid keys are:
193
194 · Control + any alphanumeric character (C-a through C-z, also a few
195 others).
196
197 · Any function key ranging from F1 to F12.
198
199 backspace
200 Default: C-h
201
202 Delete character in front of the cursor.
203
204 New in version 0.14.
205
206
207 beginning_of_line
208 Default: C-a
209
210 Move to the beginning of the line.
211
212 New in version 0.14.
213
214
215 clear_line
216 Default: C-u
217
218 Clears to the beginning of the line.
219
220 clear_screen
221 Default: C-l
222
223 Clears the screen to the top.
224
225 clear_word
226 Default: C-w
227
228 Clear the word the cursor is currently on.
229
230 copy_clipboard
231 Default: F10
232
233 Copy the entire session to clipboard.
234
235 New in version 0.14.
236
237
238 cut_to_buffer
239 Default: C-k
240
241 Cuts the current line to the buffer.
242
243 delete
244 Default: C-d
245
246 Delete character under the cursor.
247
248 down_one_line
249 Default: C-n
250
251 Move the cursor down, by one line.
252
253 edit_config
254 Default: F3
255
256 Edit bpython configuration in external editor.
257
258 New in version 0.14.
259
260
261 edit_current_block
262 Default: C-x
263
264 Edit current block in external editor.
265
266 New in version 0.14.
267
268
269 end_of_line
270 Default: C-e
271
272 Move to the of the line.
273
274 New in version 0.14.
275
276
277 exit
278 Default: C-d
279
280 Exits bpython (use on empty line)
281
282 external_editor
283 Default: F7
284
285 Edit the entire session in an external editor.
286
287 New in version 0.13.
288
289
290 help
291 Default: F1
292
293 Brings up sincerely cheerful description of bpython features and cur‐
294 rent key bindings.
295
296 New in version 0.14.
297
298
299 incremental_search
300 Default: M-s
301
302 Perform incremental search on all stored lines in the history.
303
304 New in version 0.15.
305
306
307 last_output
308 Default: F9
309
310 Shows the last output in the systems $PAGER. Only works in
311 bpython-curses.
312
313 left
314 Default: C-b
315
316 Move a character to the left.
317
318 New in version 0.14.
319
320
321 pastebin
322 Default: F8
323
324 reimport
325 Default: F6
326
327 Reruns entire session, reloading all modules by clearing the sys.mod‐
328 ules cache.
329
330 New in version 0.14.
331
332
333 reverse_incremental_search
334 Default: M-r
335
336 Perform reverse incremental search on all stored lines in the history.
337
338 New in version 0.15.
339
340
341 right
342 Default: C-f
343
344 Move a character to the right.
345
346 New in version 0.14.
347
348
349 save
350 Default: C-s
351
352 Saves the current session to a file (prompts for filename)
353
354 search
355 Default: C-o
356
357 Search up for any lines containing what is on the current line.
358
359 show_source
360 Default: F2
361
362 Shows the source of the currently being completed (python) function.
363
364 toggle_file_watch
365 Default: F5
366
367 Toggles file watching behaviour; re-runs entire bpython session when‐
368 ever an imported module is modified.
369
370 New in version 0.14.
371
372
373 transpose_chars
374 Default: C-t
375
376 Transpose current character with the one left of it.
377
378 New in version 0.14.
379
380
381 undo
382 Default: C-r
383
384 Rewinds the last action.
385
386 up_one_line
387 Default: C-p
388
389 Move the cursor up, by one line.
390
391 yank_from_buffer
392 Default: C-y
393
394 Pastes the current line from the buffer (the one you previously cut)
395
397 This refers to the [cli] section in your config file.
398
399 suggestion_width
400 Default: 0.8
401
402 The width of the suggestion window in percent of the terminal width.
403
404 New in version 0.9.8.
405
406
407 trim_prompts
408 Default: False
409
410 Trims lines starting with '>>> ' when set to True.
411
413 This refers to the [curtsies] section in your config file.
414
415 New in version 0.13.
416
417
418 list_above
419 Default: False
420
421 When there is space above the current line, whether the suggestions
422 list will be displayed there instead of below the current line.
423
424 right_arrow_completion
425 Default: True
426
427 Full line suggestion and completion (like fish shell and many web
428 browsers).
429
430 Full line completions are displayed under the cursor in gray. When the
431 cursor is at the end of a line, pressing right arrow or ctrl-f will
432 complete the full line. This option also turns on substring history
433 search, highlighting the matching section in previous result.
434
436 # This is a standard python config file
437 # Valid values can be True, False, integer numbers, strings
438 # By default bpython will look for $XDG_CONFIG_HOME/bpython/config
439 # ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the
440 # --config option on the command line
441 #
442 # see http://docs.bpython-interpreter.org/configuration.html
443 # for all configurable options
444
445 # General section tag
446 [general]
447
448 # Display the autocomplete list as you type (default: True).
449 # When this is off, you can hit tab to see the suggestions.
450 # auto_display_list = True
451
452 # Syntax highlighting as you type (default: True).
453 # syntax = True
454
455 # Display the arg spec (list of arguments) for callables,
456 # when possible (default: True).
457 # arg_spec = True
458
459 # History file (default: ~/.pythonhist):
460 # hist_file = ~/.pythonhist
461
462 # Number of lines to store in history (set to 0 to disable) (default: 100):
463 # hist_length = 100
464
465 # Soft tab size (default: 4, see pep-8):
466 # tab_length = 4
467
468 # Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme
469 # $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set
470 # to "default" to use the default theme
471 # color_scheme = default
472
473 # External editor to use for editing the current line, block, or full history
474 # Examples: vi (vim)
475 # code --wait (VS Code) - in VS Code use the command palette to:
476 # Shell Command: Install 'code' command in PATH
477 # atom -nw (Atom)
478 # Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment
479 # the line below that will take precedence
480 # editor = vi
481
482 # Whether to append .py to the filename while saving session to a file.
483 # (default: False)
484 # save_append_py = False
485
486 # The name of a helper executable that should perform pastebin upload on
487 # bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
488 #pastebin_helper = gist.py
489
490 # How long an undo must be expected to take before prompting for how
491 # many lines should be undone. Set to -1 to never prompt, or 0 to
492 # always prompt.
493 # single_undo_time = 1.0
494
495 # Enable autoreload feature by default (default: False).
496 # default_autoreload = False
497
498 [keyboard]
499
500 # All key bindings are shown commented out with their default binding
501
502 # pastebin = F8
503 # last_output = F9
504 # reimport = F6
505 # help = F1
506 # toggle_file_watch = F5
507 # save = C-s
508 # undo = C-r
509 # redo = C-g
510 # up_one_line = C-p
511 # down_one_line = C-n
512 # cut_to_buffer = C-k
513 # search = C-o
514 # yank_from_buffer = C-y
515 # backspace = C-h
516 # clear_word = C-w
517 # clear_line = C-u
518 # clear_screen = C-l
519 # show_source = F2
520 # exit = C-d
521 # external_editor = F7
522 # edit_config = F3
523 # reverse_incremental_search = M-r
524 # incremental_search = M-s
525
526 [curtsies]
527
528 # Allow the the completion and docstring box above the current line
529 # (default: False)
530 # list_above = False
531
532 # Enables two fish (the shell) style features:
533 # Previous line key will search for the current line (like reverse incremental
534 # search) and right arrow will complete the current line with the first match
535 # from history. (default: True)
536 # right_arrow_completion = True
537
538
540 bpython was written by Robert Anthony Farrell <‐
541 robertanthonyfarrel@gmail.com> and his bunch of loyal followers.
542
543 This manual page was written by Jørgen Pedersen Tjernø <‐
544 jorgen@devsoft.no>, for the Debian project (but may be used by others).
545
547 2008-2021 Bob Farrell, Andreas Stuehrk et al.
548
549
550
551
552 Apr 03, 2021 BPYTHON-CONFIG(5)