Go home

Some notes on Emacs.

Literate config

To use a literate, org-mode configuration, use the following file structure.

~/.emacs.d/init.el:

;; (org-babel-load-file "/path/to/org/file")
(org-babel-load-file (concat user-emacs-directory "config.org"))

/path/to/org-file:

#+begin_src emacs-lisp
;; Emacs config goes here
#+end_src

With this setup, every time you launch Emacs, the Elisp code blocks will be extracted from the org file and loaded. You can embed as many code blocks as you want into the org file.

Your org mode file cannot be ~/.emacs.d/init.org, because when it is converted, it will overwrite ~/.emacs.d/init.el. {.nb}

Emacs client/server

Emacs can be pretty slow to launch once you’ve done some configuring. An easy way to make the startup seem faster is by running Emacs as a daemon, and using the emacsclient to connect to it.

To start emacs as a daemon, simply run emacs --daemon, or start the emacs service with your service manager (likely systemd).

Then, instead of running emacs to start Emacs, run emacsclient -c. The startup time should be near instant.