I use the following structure to keep track of packages and files
~/.emacs.d
|-- elpa ;; Package.el packages
|-- hack ;; Development versions of packages (e.g. org, personal packages)
|-- single-lisp ;; Individual lisp files from outside sources (e.g. EmacsWiki)
|-- site-lisp ;; Lisp packages not managed by package.el (directories)
|-- user-config ;; Machine/situation specific customization (work vs home)
| `-- custom.el ;; Customization settings
|-- lisp ;; Individual .el files to keep init.el clean
| `-- defaults.el ;; Default configuration settings
`-- init.el
I then use use-package
to manage which packages are loaded and which customizations are set for each package. Most of the time only hack
and elpa
require updating, the other folders are often for one-off packages that I want to test or use briefly but do not need to load (even idly).
custom.el
is for Customize settings, which I prefer not to use (and do not version even if I do use).
defaults.el
is for general configuration (menu-bar, font, encoding, etc) that can then be overwritten in any .el file in user-config/
to allow for a system that will work as I expect, but can be adjusted to fit the environment.
I had previously tried to keep functions
, macros
, advice
in separate packages to allow for delineation between content, but ran into definition/require issues so have put those back into init.el
. They may eventually be put back into ~/.emacs.d/lisp/
.
I try to keep init.el
tidy, sort content by function and purpose so that finding it again will be straightforward. I've had the monolithic init.el
file and kept adding new content at the end (or where I thought it might fit) and then would end up not knowing what I had added or where I had added it when I went to look for it (and sometimes searching using isearch
did not help since I could not remember how I named things at the time).