Last active
June 29, 2024 10:42
-
-
Save qexat/5a954a82c1e7cd7f4f3045bad10ae676 to your computer and use it in GitHub Desktop.
My ptpython config as of 2024.06.29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
My configuration file for ptpython. | |
Want it for yourself? Put it inside `<XDG home dir>/.config/ptpython/`. | |
""" | |
## LINT COMMAND ####################################################################### | |
# ruff check ~/.config/ptpython/config.py --select ALL --ignore D212,D203,INP001,D202 # | |
####################################################################################### | |
from prompt_toolkit.enums import EditingMode | |
from prompt_toolkit.output.color_depth import ColorDepth | |
from ptpython.completer import CompletePrivateAttributes | |
from ptpython.layout import CompletionVisualisation | |
from ptpython.repl import PythonRepl | |
__all__ = ["configure"] | |
def configure(repl: PythonRepl) -> None: | |
""" | |
Configuration method. This is called during the start-up of ptpython. | |
:param repl: `PythonRepl` instance. | |
""" # noqa: D401 | |
repl.editing_mode = EditingMode.EMACS | |
repl.cursor_shape_config = "Beam" | |
repl.complete_while_typing = True | |
repl.complete_private_attributes = CompletePrivateAttributes.IF_NO_PUBLIC | |
repl.enable_fuzzy_completion = True | |
repl.enable_dictionary_completion = True | |
repl.enable_history_search = False | |
repl.enable_mouse_support = True | |
repl.confirm_exit = False | |
repl.enable_input_validation = True | |
repl.enable_auto_suggest = True | |
repl.accept_input_on_enter = 2 | |
repl.completion_visualisation = CompletionVisualisation.POP_UP | |
repl.prompt_style = "classic" | |
repl.insert_blank_line_after_input = False | |
repl.insert_blank_line_after_output = False | |
repl.show_signature = True | |
repl.show_docstring = True | |
repl.show_line_numbers = True | |
repl.show_meta_enter_message = True | |
repl.wrap_lines = False | |
repl.show_status_bar = False | |
repl.show_sidebar_help = True | |
repl.highlight_matching_parenthesis = True | |
repl.enable_output_formatting = True | |
repl.enable_pager = True | |
repl.enable_syntax_highlighting = True | |
repl.swap_light_and_dark = True | |
repl.use_code_colorscheme("github-dark") | |
repl.use_ui_colorscheme("default") | |
repl.color_depth = ColorDepth.TRUE_COLOR | |
repl.min_brightness = 0.0 | |
repl.max_brightness = 1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment