Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable "vi mode" for the python 3.13 interactive interpreter?

One of the new features in python 3.13 is a more sophisticated interactive interpreter. However, it seems that this interpreter is no longer based on readline, and therefore no longer respects ~/.inputrc. I particularly miss the set editing-mode vi behavior. Is there a way to get this same "vi mode" behavior with the python 3.13 interpreter (other than just disabling the new interpreter completely with PYTHON_BASIC_REPL=1)?

Caveat: The specific version of python I'm using is 3.13.0b3. This is a beta release, so I'd be satisfied if the answer is "just wait for the actual release of python 3.13; this feature is planned but hasn't been implemented yet".

like image 982
Kale Kundert Avatar asked Oct 18 '25 14:10

Kale Kundert


1 Answers

According to this CPython issue and this comment on another issue, vi editing mode is not coming any time soon to the new REPL. It is still possible to use the old REPL by setting the PYTHON_BASIC_REPL=1 environmental variable.

like image 99
Andrea Olivo Avatar answered Oct 21 '25 05:10

Andrea Olivo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!