Breaking up init.el (Emacs Reboot #13)

My brand-new init.el has been steadily growing. Before I go any further, it’s time to break it up into manageable pieces.

I add some code to init.el which will load all elisp files in ~/.emacs24.d/init.d:

Then I go through init.el and pull almost all of it out into separate files in init.d:

I give a few of the files special name prefixes to force the order in which they are loaded. I want load paths to be set up before anything else, so I prefix that file with 00_. I want to defer keybindings until everything else has been loaded, so I use a prefix of ZZ_ for that file. Since the default behavior of directory-files is to lexically sort the file names, I can rely on file prefixes to determine load order.

This post is part of the Emacs Reboot series. Check out the rest of the series for more Emacs goodness. You can also subscribe to a podcast feed of just the videos.