I don't know what %edit does, but if I guess that it has something to do with an editor, I use this in my dotfiles:
https://github.com/Julian/dotfiles/blob/master/.pythonrc#L55
which is perfectly REPL agnostic.
I prefer bpython over iPython for a bunch of reasons that I can't easily elaborate on from here on my mobile, but is definitely suggest people try them both out.