A very common need for config is to run code after the InteractiveShell is initialised - e.g. to define extra magics or aliases, or to import modules. Currently, the user has to track down exec_lines in the config file, and put their code inside a string (i.e. it doesn't get syntax highlighted etc.), or save a file in a suitable place, and add it to exec_files.
I propose either:
I am +1 on this. It's frustrating that we boast this new config system, but a lot of what people want has to be done through the ugly strings of code. I know we have Extensions and Plugins, but those are too heavyweight for what most people want.
In fact, this is quite trivial to implement see here for a working implementation, but we should get consensus before adding something like this.
Min's implementation (e80f7aa) works for me for defining local magic. Compared to finding and editing ipython_config.py, this is way easier to figure out. It might be nice to reference this in either the '%quickref' or '%magic' documentation so that it's easy to discover from an interactive session.
@takluyver - yes, that would be easy. I'll do it before making a PR
add startup_dir to profiles
Any .py or .ipy file in this directory will be run at startup.
Files are run in in lexicographical order, as described in #914