12

Basically I would like to have (custom-set-variables ...) in a seperate file and for me to load that file.

This is just for the purpose of organisation of my init file.

How can I change the default location of custom-set-variables?

Jessie
  • 317
  • 1
  • 6
  • 3
    Good question. Not enough users make use of `custom-file`, IMO. The Emacs doc should make it more prominent, and even provide for it being used by default, rather than letting Customize pollute the init file. – Drew Apr 03 '16 at 16:01

2 Answers2

11

Set the custom-file variable in your init file.

C-hv custom-file RET

phils
  • 48,657
  • 3
  • 76
  • 115
  • 1
    And note that although this is a user option, you probably do not want to count on setting it only using Customize, i.e., setting it in your `custom-file'. ;-) – Drew Apr 03 '16 at 16:00
8

Example of exact text you may want to place in your init.el:

(setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file 'noerror)
ideasman42
  • 8,375
  • 1
  • 28
  • 105