Skip to content

Instantly share code, notes, and snippets.

@hunterlawson
Created March 27, 2023 06:47
Show Gist options
  • Save hunterlawson/acf4f65f30867d1642926ad91bc9839d to your computer and use it in GitHub Desktop.
Save hunterlawson/acf4f65f30867d1642926ad91bc9839d to your computer and use it in GitHub Desktop.
Doom Emacs Windows installation steps

Installing Doom Emacs on Windows

More guides:

Installing Emacs

The easiest way to install Emacs is by using Chocolatey:

$ choco install emacs

Verify that it is installed by running this in a terminal:

$ emacs

A default Emacs window should open.

Installing Doom

Clone the Doom Emacs git repository. Run this command in Powershell:

$ git clone https://github.com/doomemacs/doomemacs.git ~/.emacs.d

Next you need to set your environment variables to include HOME. Open the start menu and type "environment" and select "Edit the System Environment Variables". Click on "Environment Variables" on the lower right of the menu. Under "System Variables", add a new entry with the name "HOME" and value equal to the location of your user directory. This should be something like "C:\Users<USER>".

After this is done, you can run the doom emacs install script. Run this command in Powershell:

$ ~/.emacs.d/bin/doom install

Running

You should now be able to run Doom Emacs by just typing emacs in a terminal. You might notice that it may be slow to start and hang sometimes. This is because you are meant to use Emacs as a client/server application. Emacs comes with a server that you can run and then connect to with emacs clients. This makes it launch a lot faster.

Launch an emacs server by running:

$ emacs --daemon

Connect to it by running:

$ emacsclient -c

Making a taskbar shortcut

When you installed Emacs through Chocolatey, it created binaries for emacs, emacsclient, emacsclientw, and runemacs. emacsclientw is the one you want to use since it will create an emacs client in a new window. To make a shortcut to this to use on the taskbar:

  • Launch emacs by running emacs in a terminal.
  • Pin the resulting window to the taskbar.
  • Right-click on the taskbar icon to see a popup dialog and right-click on emacs and select "Properties".
  • Change the target to: "C:\tools\emacs\bin\emacsclientw.exe -c -a="
  • This will then launch an emacs client. If a server isn't running, it will start one and connect to it.

Automatically start Emacs server

To automatically start the emacs server whenever your computer restarts:

  • Make a shortcut in the "C:\Users<USER>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" directory
  • The target will be "C:\tools\emacs\bin\runemacs.exe --daemon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment