Commit f0d2bde6961f5920ebbb08cb4c1d270a87eee681 Parent: dbe0c04fc9ae3575ddf791aa26089087b49341e3 Author: mcol <mcol@posteo.net> Date: 2024-12-21 19:42:32 +0000 Committer: mcol <mcol@posteo.net> Committed: 2024-12-21 19:42:32 +0000 add pythonrc to repo
zshrc Modified
@@ -66,7 +66,8 @@ LANG=en_GB.UTF-8 \ LC_CTYPE=en_GB.UTF-8 \ PAGER="less --mouse" \ - RANGER_LOAD_DEFAULT_RC=FALSE + RANGER_LOAD_DEFAULT_RC=FALSE \ + PYTHONSTARTUP=~/.zsh/pythonrc.py # ensure that the prompt is redrawn when the terminal size changes. TRAPWINCH () { zle && zle -R }
pythonrc.py Added
@@ -0,0 +1,19 @@ +import os +import sys +from pprint import pprint + +try: + from ptpython.repl import embed as _embed +except ImportError: + print("ptpython is not available: falling back to standard prompt") +else: + sys.exit( + _embed( + globals(), + locals(), + vi_mode=True, + history_filename=os.environ.get( + "PYTHON_HISTORY", os.path.expanduser("~/.python_history") + ), + ) + )