Emacs Init: File Location

By Xah Lee. Date: . Last updated: .

Where is Init File

No Init File by Default

By default, there is no init file. You have to create the file yourself, and add emacs lisp code to it.

Init File Location On Linux and Mac

On linux and Mac, by default, emacs look for init file at the following filepath, in order:

  1. ~/.emacs
  2. ~/.emacs.el
  3. ~/.emacs.d/init.el (this is preferred since ~2010)
  4. ~/.config/emacs/init.el (linux convention XDG_CONFIG_HOME environment variable, supported since Emacs 27 (date 2020).)

Init File Location on Microsoft Windows

Variable of Emacs Init File Location

Start emacs, type Alt+x describe-variable, then type user-emacs-directory

it'll show the init file path emacs is looking for.

Emacs init file topics