[IPython-User] make %ed default to '%ed -p'

Fernando Perez fperez.net@gmail....
Tue Sep 7 01:44:43 CDT 2010

On Mon, Sep 6, 2010 at 1:01 PM, Lara Michaels
<laramichaels1978@yahoo.com> wrote:
> I love ipython, but have the following question!
> Is there an easy configuration trick to get the editor to always open the same file I previously edited? Basically, I want 'ed' to mean 'ed -p'!

If you are using the 'old style' config file ~/.ipython/ipythonrc, add this:

execute __IPYTHON__.default_option('edit','-p')

if your config file is the 0.10 style ~/.ipython/ipy_user_conf.py, you
should have something like:

import IPython.ipapi
ip = IPython.ipapi.get()

then just add:


%ed is just a shorthand for %edit, so the default option has to be
added to %edit itself, not to %ed.

I hope this helps.

> Many thanks for any help and my thanks for this great piece of code!! : )
> ~l

Thanks for the kind words.

Please note that some of the details of configuring ipython will
change in a few months with 0.11, so be advised that you'll need to
revisit this little trick.

We'll do our best to provide guidance on how to update your setup.



More information about the IPython-User mailing list