IDLE history, Python IDE, and Interactive Python with Vim

Ashot ashot at removemolsoftthis.com
Mon Feb 7 02:06:11 EST 2005


On Mon, 07 Feb 2005 00:55:07 -0600, Ashot <ashot at removemolsoftthis.com> wrote:

> On Sat, 05 Feb 2005 11:07:40 -0700, Fernando Perez <fperez.net at gmail.com> wrote:
>
>> Hi,
>>
>> Ashot wrote:
>>
>>> This is sort of both Python and Vim related (which is why I've posted to
>>> both newsgroups).
>>
>> [...]
>>
>> I know you've been using ipython recently (the readline color bugs), so perhaps
>> my reply is a bit redundant.  Forgive me if that's the case, I just want to
>> give you some useful info.
>>
>> Just in case you haven't come across these features (the manual is kind of long
>> and dry), I should note that ipython has pretty much everything you've asked
>> for here.  %hist -n dumps your history without line numbers (for copy/paste),
>> %logstart gives you an incremental log (valid python code) of your current
>> session, %save allows you to save a selected group of lines to a file, and
>> %edit will open up $EDITOR (or vi in Unix by default) at the source of any
>> accessible object.  With %pdb, you can even trigger automatically pdb at any
>> uncaught exception (in Emacs, you'll even get the source simultaneously opened,
>> I'm sure something similar could be done for vi).
>
> yup, this is why I've been using it, its (almost exactly :) what I was looking for.  I had tried it before, but was reluctant to use it because the windows terminal is not very appealing.
> Some things I've noticed so far that I think could be improved, some of which are minor but annoying:
>
> 	edit doesn't work with classes even though it says it should, you have to point it to a function in the class (perhaps only in windows)
>
> 	under windows vim/gvim doesn't jump to the line of the function.. you said that this should work in vi, but I'm guessing its a Windows thing
>
> 	**the biggest problem for me is edit forgets code  in which there were errors. for example:"ed" type some nonsense, and ed -p doesn't remember.  Thats putting an awful lot of pressure on getting the syntax right everytime =]  Perhaps I am missing something here?
>
> 	it would be really great if the code executed on save rather than exit, but I'm not sure if this is possible.  This would be very useful for people using an editor not in the console.. that way you wouldn't have to keep opening/closing new editor windows.
>
> 	this isn't a big deal, but it would be nice if there was an easy way to refer to the entire history (for edit/save/etc)
>
> 	would be nice if you could send stuff to the clipboard.

	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

	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.

	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.

	Again, thanks for your  help.

.a



More information about the Python-list mailing list