IDLE history, Python IDE, and Interactive Python with Vim

Fernando Perez fperez.net at gmail.com
Tue Feb 8 00:38:53 EST 2005


Ashot wrote:

> Sorry, a few more things I forgot to mention having to do with editing
> multiline entries in the console:
> 
> Autotab setting doesn't seem to have any effect, I have to type "ctrl-o"
> manually

I've noticed it doesn't work under win32.  It's fine under *nix.  There's only
so much Gary can do with his readline supplement in a win32 environment, I'm
not sure if this is something which he could add, you'd have to contact him
directly.  This would require support for insertions into the current line,
which may not even be possible in a windows terminal, I just don't know.

> Is there a setting that treats multiline entries as a single command, as IDLE
> does? In otherwords, allowing you to edit the entire entry, going up to
> previous lines, and treating as one when cycling through the history?  It
> seems like ipython recognizes these through the hist command, but not when
> editing or cycling.

This is impossible in a line-oriented terminal program.  What you are asking for
requires 2-d cursor control, which can only be provided in a gui environment,
or with curses in a terminal (or with custom terminal handling code). 
Basically, it means writing a complete screen-handling program, which is far
more than ipython can do.

I keep trying to start an internal ipython cleanup, so it could be embedded into
a gui environment.  Once that happens, it may be possible to use idle or
pycrust but with the ipython engine.  

Within the design constraints of not taking over the terminal with a curses (or
similar) environment, restricted to onlw raw_input() communication with the
user, what you are asking is a technical impossibility.

> Is it possible to use the "set editing-mode vi" option in ipython since it
> uses readline?  From reading online, it seems like this should be possible,
> however it doesn't work for me.   It works in bash, but once I enter either
> ipython or just regular python the keybindings don't work anymore.

I don't know if this works even under *nix, since I don't know if the python
readline library wraps this part of GNU readline.  I _do_ know that python only
wraps a subset of GNU readline, so I wouldn't be surprised if this wasn't
included.  It is not something specific to ipython, you'd have to ask the
readline developers directly.

Best,

f




More information about the Python-list mailing list