I’ve never really liked the built-in customization UI in Emacs (
M-x customize). I’m sure plenty of people use it and enjoy it, but, to me, it feels like an abominable tree of never ending and difficult to navigate options. Plus, it sticks your saved customizations as an unorganized mess of elisp smack at the bottom of your init file. I’m not quite sure how to solve my first gripe, but the second is manageable.
By setting the
custom-file variable, you can keep those automated customizations in a separate file. Put this in your Emacs init:
(setq custom-file "~/.emacs.d/custom.el") (load custom-file 'noerror)
Both lines are necessary. The first line tells Custom to save all customizations in the file, but does not load it. The
'noerror argument passed to
load prevents errors if the file doesn’t exist. If you had existing customizations in your init file, be sure to copy them to the new custom file.
Now, go enjoy a cleaner init file. This tip is especially useful if you keep your init files under a version control system. You do keep your init files under version control, right?