A Hy enhanced REPL.
Compatible with Hy 1.2.0 and later.
$ pip install -U hy-fancy-replThe REPL implements multi-line editing, completion, live input validation, live syntax highlighting, bracket matching, enhanced tracebacks, and interactive matplotlib plots.
$ hy-replor
$ hy-fancy-repl- Multi-line editing with smart indentation
- Syntax highlighting via Pygments
- Bracket matching that ignores brackets inside strings and comments
- Tab completion with Hy's native completer
- Live validation - shows a red 'x' when parentheses are unbalanced
- Enhanced tracebacks - shows syntax-highlighted source snippets
- Interactive matplotlib - async plot updates when available
- History persistence - saved to
~/.hy-historyby default
The REPL's behaviour may be modified with the following environment variables:
| Variable | Description | Default |
|---|---|---|
HY_HISTORY |
Path to command history file | ~/.hy-history |
HY_LIVE_COMPLETION |
Enable live autocompletion dropdown | unset (off) |
HY_PYGMENTS_STYLE |
Pygments style for highlighting | lightbulb |
HY_VI_MODE |
Enable vi line-editing mode | unset (emacs) |
HY_TRACEBACK_IGNORE |
Comma-separated list of files to hide in tracebacks | sensible defaults |
By default, the REPL hides infrastructure files in tracebacks to show your code. The default ignore list includes Hy internals, funcparserlib, and multimethod.
Override with HY_TRACEBACK_IGNORE:
$ HY_TRACEBACK_IGNORE="hy/repl.py,code.py" hy-fancy-replOr modify at runtime:
from hy_fancy_repl.repl import TRACEBACK_IGNORE
# TRACEBACK_IGNORE is a tuple of file path suffixes to ignoreThe REPL uses pygments, prompt-toolkit, colorist, and Hy.
See CONTRIBUTING.md for development setup and contribution guidelines.
Try clicking below.