Install Doom Emacs as explained in the readme.

Alongside it, you’ll want to install ripgrep and fd for better search integration, and possibly ttf-font-awesome for better icons.

Configuration Link to heading

Instead of the default ~/emacs.d/ and ~/doom.d/ config directories, you can also use ~/.config/emacs/ and ~/.config/doom/.

init.el Link to heading

My init.el is mostly default, and enables the languages I regularly use, with LSP support where possible:

Example 1.

… :editor (format +onsave) ; automated prettiness

:tools lsp

   :lang
   (cc ~~lsp)         ; C > C+~~ == 1
   markdown          ; writing docs for people to ignore
   (python +lsp)     ; beautiful is better than ugly
   sh                ; she sells {ba,z,fi}sh shells on the C xor
   (yaml +lsp)       ; JSON, but readable

Note that some of these need additional programs to be installed, like clangd for C++, black for Python formatting, and prettier for more formatting.

I use the treemacs project drawer, and (ivy +icons +prescient) for searching. Add +fuzzy for fuzzy searching. (I found it too fuzzy for my taste.)

For git integration, magit is great.

To install additional packages from MELPA, add them to packages.el:

Example 2.

(package! pkgbuild-mode) (package! bazel)

config.el Link to heading

Some highlights from my config.el. (Remember, SPC f p quickly opens files in your emacs config directory.)

  • Always keep 10 lines of buffer above/below the cursor: (setq scroll-margin 10)

  • Save buffer and exit insert mode on focus loss

    Example 3.

    ;; Auto save buffers on focus lost (add-function :after after-focus-change-function (lambda () (save-some-buffers t))) ;; Exit insert mode on focus loss (add-function :after after-focus-change-function (lambda () (evil-normal-state)))