Using Python Shell in Vi Mode on Windows

I know that you can use the Python shell in Vi mode on Unix-like operating systems. For example, I have this line in mine ~/.inputrc:

set editing-mode vi

This allows me to use Vi style editing inside the Python shell.

But can this be done if you use Python in a Windows XP window? I am using pre-built Python for Windows, downloaded directly from python.org.

I assume that the Windows version does not use the GNU Readline library, but I would be happy to be mistaken. :)

+3
source share
3 answers

Install PyReadline

pyreadlineconfig.ini PYTHONSTARTUPFILE PyReadline.

pyreadlineconfig.ini:

set_mode("vi")
history_filename("~/.pythonhistory")
history_length(200)

.

, ESC K, .

+2

cygwin Unix-y " Windows XP" ( Python, - Windows " Windows" ) - !

+1

, , PyReadline IPython, Vi, Linux. , ESC, k, .

0

Source: https://habr.com/ru/post/1724578/


All Articles