Emacs: Init File Tutorial

By Xah Lee. Date: . Last updated: .

This page shows you how to set up many preferences in emacs.

The following assume you are using Emacs 26 (Released 2018-06) or later.

What is Init File

Emacs init file is a file emacs loads when it starts up. It is used to customize emacs.

Emacs init file is also known as “dot emacs file”.

Where is Init File

Can i delete the emacs init file?

Yes. It's ok to delete your init file and start over. (if you don't have anything important you put there.)

Start Emacs Without Loading Init File

Load Modified Init File Without Restarting Emacs

See Evaluate Emacs Lisp Code. Once the code is evaluated, effect are immediate.

Note, some packages, or elisp code, may behave differently when loaded twice. And some code may not work by simply running it by itself (it may assume some other code has been loaded before or after.).

If you have a problem, restart emacs.

Restart Emacs

Alt+x restart-emacs

(new in Emacs 29 (Released 2023-07))

much thanks to jcs. http://irreal.org/blog/

Thanks to Ivan Kozik (http://ludios.org/ivank/) for a tip.


Emacs, start up and init files