|
NAMEbpython-config - user configuration file for bpythonSYNOPSIS$XDG_CONFIG_HOME/bpython/configDESCRIPTIONThe configuration file contains various options controlling the behaviour of bpython.GENERALThis refers to the [general] section in your $XDG_CONFIG_HOME/bpython/config file.arg_specDisplay the arg spec (list of arguments) for callables, when possible (default: True).auto_display_listDisplay the autocomplete list as you type (default: True). When this is off, you can hit tab to see the suggestions.autocomplete_modeThere are four modes for autocomplete: none, simple, substring, and fuzzy. Simple matches methods with a common prefix, substring matches methods with a common subsequence, and fuzzy matches methods with common characters (default: simple). None disables autocompletion.New in version 0.12. color_schemeSee themes for more information.Color schemes should be put in $XDG_CONFIG_HOME/bpython/. For example, to use the theme $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo Leave blank or set to "default" to use the default (builtin) theme. complete_magic_methodsWhether magic methods should be auto completed (default: True).dedent_afterNumber of blank lines required before next line will be dedented (default: 1). If set to 0, automatic dedenting never occurs.editorEditor for externally editing the current line, session, or config file.New in version 0.13. flush_outputWhether to flush all output to stdout on exit (default: True).Only relevant to bpython-curses and bpython-urwid. highlight_show_sourceWhether the source code of an object should be syntax highlighted (default: True).hist_duplicatesWhether to store duplicate entries in the history (default: True).hist_fileHistory file (default: ~/.pythonhist).hist_lengthNumber of lines to store in history (set to 0 to disable) (default: 100).paste_timeThe time between keypresses before pastemode is deactivated in bpython-curses (default: 0.02).pastebin_confirmWhether pasting to a pastebin needs to be confirmed before sending the data (default: True).pastebin_expiryTime duration after which a paste should expire. Valid values are 1day, 1week and 1month (default: 1week).New in version 0.14. pastebin_helperThe name of a helper executable that should perform pastebin upload on bpython's behalf. If set, this overrides pastebin_url. The helper is expected to return the full URL to the pastebin as the first word of its output. The data is supplied to the helper via STDIN.An example helper program is pastebinit, available for most systems. The following helper program can be used to create gists: #!/usr/bin/env python import sys import requests import json def do_gist_json(s): """ Use json to post to github. """ gist_public = False gist_url = "https://api.github.com/gists" data = { "description": "Gist from bpython", "public": gist_public, "files": { "sample": { "content": s }, }, } headers = { "Content-Type": "application/json", "X-Github-Username": "YOUR_USERNAME", "Authorization": "token YOUR_TOKEN", } try: res = requests.post(gist_url, data=json.dumps(payload), headers=headers) res.raise_for_status() json_res = json.loads(res.read()) return json_res["html_url"] except requests.exceptions.HTTPError as err: return err if __name__ == "__main__": s = sys.stdin.read() print(do_gist_json(s)) New in version 0.12. pastebin_urlThe pastebin url to post to (without a trailing slash). This pastebin has to be a pastebin which provides a similar interface to bpaste.net's JSON interface (default: https://bpaste.net).save_append_pyWhether to append .py to the filename while saving the input to a file.New in version 0.13. single_undo_timeTime duration an undo must be predicted to take before prompting to undo multiple lines at once. Use -1 to never prompt, or 0 to always prompt. (default: 1.0)New in version 0.14. syntaxSyntax highlighting as you type (default: True).tab_lengthSoft tab size (default 4, see PEP-8).unicode_boxWhether to use Unicode characters to draw boxes.New in version 0.14. import_completion_skiplistA :-seperated list of patterns to skip when processing modules for import completion.New in version 0.21. KEYBOARDThis section refers to the [keyboard] section in your $XDG_CONFIG_HOME/bpython/config.You can set various keyboard shortcuts to be used by bpython. However, we have yet to map all keys to their respective control codes. If you configure a key combination which is not yet supported by bpython it will raise an exception telling you the key does not exist in bpython.keys. Valid keys are:
backspaceDefault: C-hDelete character in front of the cursor. New in version 0.14. beginning_of_lineDefault: C-aMove to the beginning of the line. New in version 0.14. clear_lineDefault: C-uClears to the beginning of the line. clear_screenDefault: C-lClears the screen to the top. clear_wordDefault: C-wClear the word the cursor is currently on. copy_clipboardDefault: F10Copy the entire session to clipboard. New in version 0.14. cut_to_bufferDefault: C-kCuts the current line to the buffer. deleteDefault: C-dDelete character under the cursor. down_one_lineDefault: C-nMove the cursor down, by one line. edit_configDefault: F3Edit bpython configuration in external editor. New in version 0.14. edit_current_blockDefault: C-xEdit current block in external editor. New in version 0.14. end_of_lineDefault: C-eMove to the of the line. New in version 0.14. exitDefault: C-dExits bpython (use on empty line) external_editorDefault: F7Edit the entire session in an external editor. New in version 0.13. helpDefault: F1Brings up sincerely cheerful description of bpython features and current key bindings. New in version 0.14. incremental_searchDefault: M-sPerform incremental search on all stored lines in the history. New in version 0.15. last_outputDefault: F9Shows the last output in the systems $PAGER. Only works in bpython-curses. leftDefault: C-bMove a character to the left. New in version 0.14. pastebinDefault: F8reimportDefault: F6Reruns entire session, reloading all modules by clearing the sys.modules cache. New in version 0.14. reverse_incremental_searchDefault: M-rPerform reverse incremental search on all stored lines in the history. New in version 0.15. rightDefault: C-fMove a character to the right. New in version 0.14. saveDefault: C-sSaves the current session to a file (prompts for filename) searchDefault: C-oSearch up for any lines containing what is on the current line. show_sourceDefault: F2Shows the source of the currently being completed (python) function. toggle_file_watchDefault: F5Toggles file watching behaviour; re-runs entire bpython session whenever an imported module is modified. New in version 0.14. transpose_charsDefault: C-tTranspose current character with the one left of it. New in version 0.14. undoDefault: C-rRewinds the last action. up_one_lineDefault: C-pMove the cursor up, by one line. yank_from_bufferDefault: C-yPastes the current line from the buffer (the one you previously cut) CLIThis refers to the [cli] section in your config file.suggestion_widthDefault: 0.8The width of the suggestion window in percent of the terminal width. New in version 0.9.8. trim_promptsDefault: FalseTrims lines starting with '>>> ' when set to True. CURTSIESThis refers to the [curtsies] section in your config file.New in version 0.13. list_aboveDefault: FalseWhen there is space above the current line, whether the suggestions list will be displayed there instead of below the current line. right_arrow_completionDefault: TrueFull line suggestion and completion (like fish shell and many web browsers). Full line completions are displayed under the cursor in gray. When the cursor is at the end of a line, pressing right arrow or ctrl-f will complete the full line. This option also turns on substring history search, highlighting the matching section in previous result. SAMPLE CONFIG# This is a standard Python config file. # Valid values can be True, False, integer numbers, and strings. # Lines starting with # are treated as comments. # # By default bpython will look for $XDG_CONFIG_HOME/bpython/config # ($XDG_CONFIG_HOME defaults to ~/.config) or you can specify a file with the # --config option on the command line. # # See http://docs.bpython-interpreter.org/configuration.html for all # configurable options. # General section tag [general] # Display the autocomplete list as you type (default: True). # When this is off, you can hit tab to see the suggestions. # auto_display_list = True # Syntax highlighting as you type (default: True). # syntax = True # Display the arg spec (list of arguments) for callables, # when possible (default: True). # arg_spec = True # History file (default: ~/.pythonhist): # hist_file = ~/.pythonhist # Number of lines to store in history (set to 0 to disable) (default: 100): # hist_length = 100 # Soft tab size (default: 4, see pep-8): # tab_length = 4 # Color schemes should be put in $XDG_CONFIG_HOME/bpython/ e.g. to use the theme # $XDG_CONFIG_HOME/bpython/foo.theme set color_scheme = foo. Leave blank or set # to "default" to use the default theme # color_scheme = default # External editor to use for editing the current line, block, or full history # Examples: vi (vim) # code --wait (VS Code) - in VS Code use the command palette to: # Shell Command: Install 'code' command in PATH # atom -nw (Atom) # Default is to try $EDITOR and $VISUAL, then vi - but if you uncomment # the line below that will take precedence # editor = vi # Whether to append .py to the filename while saving session to a file. # (default: False) # save_append_py = False # The name of a helper executable that should perform pastebin upload on # bpython's behalf. If unset, bpython uploads pastes to bpaste.net. (default: ) #pastebin_helper = gist.py # How long an undo must be expected to take before prompting for how # many lines should be undone. Set to -1 to never prompt, or 0 to # always prompt. # single_undo_time = 1.0 # Enable autoreload feature by default (default: False). # default_autoreload = False [keyboard] # All key bindings are shown commented out with their default binding # pastebin = F8 # last_output = F9 # reimport = F6 # help = F1 # toggle_file_watch = F5 # save = C-s # undo = C-r # redo = C-g # up_one_line = C-p # down_one_line = C-n # cut_to_buffer = C-k # search = C-o # yank_from_buffer = C-y # backspace = C-h # clear_word = C-w # clear_line = C-u # clear_screen = C-l # show_source = F2 # exit = C-d # external_editor = F7 # edit_config = F3 # reverse_incremental_search = M-r # incremental_search = M-s [curtsies] # Allow the the completion and docstring box above the current line # (default: False) # list_above = False # Enables two fish (the shell) style features: # Previous line key will search for the current line (like reverse incremental # search) and right arrow will complete the current line with the first match # from history. (default: True) # right_arrow_completion = True AUTHORbpython was written by Robert Anthony Farrell <robertanthonyfarrel@gmail.com> and his bunch of loyal followers.This manual page was written by Jørgen Pedersen Tjernø <jorgen@devsoft.no>, for the Debian project (but may be used by others). COPYRIGHT2008-2021 Bob Farrell, Andreas Stuehrk, Sebastian Ramacher, Thomas Ballinger, et al.
Visit the GSP FreeBSD Man Page Interface. |