Skip to content

Install Doom Emacsλ︎

Install prerequisites: Emacs, Java 17, Clojure CLI and Command Line tools

  1. Clone Doom Emacs to ~/.config/emacs
  2. Clone practicalli/doom-emacs-config configuration to add common modules for Clojure development and related languages. Or edit ~/.config/doom/init.el and define the Doom modules required. Follow the Doom configuration section for details.
  3. [optional] Install Fira Code font (change dotspacemacs-default-font to a name of a font on your operating system in .spacemacs.d/init.el in step 4) 4.

Clone Doom Emacsλ︎

Use your favourite git client or the following command in a terminal window to clone Spacemacs and then run the Doom Emacs install script

git clone https://github.com/hlissner/doom-emacs ~/.config/emacs

~/.config/emacs/bin/doom install

~/.config/doom directory will be created by the install and contain the default configuration.

git clone https://github.com/hlissner/doom-emacs ~/.emacs.d

~/.emacs.d/bin/doom install

Add Doom command to pathλ︎

Doom provides tools to check the user configuration, doom doctor, and to update modules, `Either add.config/emacs/bin` to the system path

Create a symbolic link called doom from the local user bin directory to the Doom Emacs installation bin/doom file

ln -s ~/.config/emacs/bin/doom .local/bin/doom

In the user shell configuration file (~/.bashrc, ~/.zshenv), export the PATH environment variable and include the path to the Doom Emacs install bin directory

export PATH=$PATH:$HOME/.config/emacs/bin

Clone Practicalli Doom configurationλ︎

Remove the autogenerated configuration from the Doom install

mv ~/.config/doom ~/.config/doom-backup

Clone practicalli/doom-emacs-config or first create a fork and clone that fork

Using SSH

git clone git@github.com:practicalli/doom-emacs-config.git ~/.config/doom

Using HTTPS

git clone https://github.com/practicalli/doom-emacs-config ~/.config/doom

Using SSH

git clone git@github.com:practicalli/doom-emacs-config.git ~/.config/doom

Using HTTP

git clone https://github.com/practicalli/doom-emacs-config ~/.config/doom

Check & Update Doom Emacsλ︎

doom doctor diagnoses common issues with your environment and setup, and may offer clues about what is wrong.

doom sync ensures Emacs packages are installed, orphaned packages are removed and autoloads/cache files are up to date.

 doom doctor && doom sync
doom doctor - successful output example

Doom doctor - successful output

Install Fira Code fontλ︎

Install Fira Code

practicalli/doom-emacs-config uses Fira Code, a mono-spaced font designed for source code and includes ligatures and many other features.

Fira Code font - ligatures for Emacs and Clojure code

Use a different font with practicalli/doom-emacs-config

To use a different font when using the practicalli/doom-emacs-config, edit .config/doom/config.el and update the value for doom-font and any variations of fonts required

(setq doom-font (font-spec :family "Fira Code" :size 14)
      doom-big-font (font-spec :family "Fira Code" :size 24)
      doom-variable-pitch-font (font-spec :family "Ubuntu" :size 16))

Language Serversλ︎

Some languages support Language Server Protocol to provide static analysis of code structure and provide live linting and other features. Each language will require installation of its own language server, most often as a nodejs package.

sudo npm install --global vscode-json-languageserver dockerfile-language-server-nodejs vscode-html-languageservice vscode-css-languageservice yaml-language-server

Or install a language server for the specific language

clojure-lsp.io provides the language server implementation for Clojure. Follow the relevant operating system install guide

On Linux machines, Practicalli recommends installing the latest clojure-lsp release to ~/.local/bin/

Add (json +lsp) doom module in .config/doom/init.el and install the JSON language server

sudo npm install --global yaml-language-server

Add (docker +lsp) doom module in .config/doom/init.el and install the Dockerfile language server

sudo npm install --global dockerfile-language-server-nodejs

Add (web +lsp) doom module in .config/doom/init.el and install the HTML and CSS language servers

sudo npm install --global vscode-html-languageservice vscode-css-languageservice

Add (yaml +lsp) doom module in .config/doom/init.el and install the YAML language server

sudo npm install --global yaml-language-server

Doom Emacs readyλ︎

Doom Emacs is and ready to help you take on the world. Run emacs from a desktop launcher or on the command line:

emacs

Native compliation initial high cpu use

On first running Emacs after Doom install added packages, the elisp code will be compiled to native binaries. The compilation will use considerable CPU resources.

If you already know how to use Doom Emacs, jump to the Clojure Projects section, otherwise look through the Doom Basics to learn how to use Vim style editing and work with files, buffers and windows.