Where do I put IPython configuration files?

I have been trying to set my %edit editor to Emacs for a while and made very slow progress.

The IPython 0.13 docs were unclear about how to actually configure this. It told me to set EDITOR to the desired editor (in my case, "emacsclient") by adding

c = get_config()
c.InteractiveShell.editor = 'emacsclient'

to my config in my ipython folder.

However, I couldn't find any such folder. I spent a very long time looking around to find just how to set IPython environment variables and found only related snippets. What code to use. The difference between .py and .ipy files for startup scripts. Etc.

I am using Ubuntu 12.10. Where do I put my config file for IPython 0.13?


Solution 1:

I have c.TerminalInteractiveShell.editor = 'emacsclient' in ~/.config/ipython/profile_default/ipython_config.py and it works.

If you have trouble finding config location, use ipython locate profile command: http://ipython.org/ipython-doc/rel-0.13/whatsnew/version0.13.html#new-top-level-locate-command

But I think the easiest way to setup editor is to have something like export EDITOR=emacsclient in your shell setup (e.g. ~/.bashrc).