Emacs Init: File Location
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:
~/.emacs
~/.emacs.el
~/.emacs.d/init.el
(this is preferred since ~2010)~/.config/emacs/init.el
(linux conventionXDG_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.