Doom, Emacs & Windows

Doom-emacs. It's a configuration framework for Emacs. Basically, it overrides the Emacs keybindings with most of vim's.

As I mentioned in the last post. I started using Emacs at work due to org-mode… and work PC's use windows behind a Firewall, so using git, pip, melpa and some more are useless in my work desktop (In the Laptop all of them work if I connect to another network, which was what I did).

As you can imagine, Doom is for a GNU program so Windows support is limited (because, who cares?). The guide is poor, it describes how to install it with scoop/chocolatey (that don't work with a firewall). However, you can use the git-bash to install Doom without scoop/chocolatey. Here is how you do it:

What you need

If you have limited permissions in Windows PC (e.g. admin privileges), you might not be able to use Chocolatey/Scoop. However, you can still use git-bash.exe portable version!

  • Download git.

  • Download Ripgrep and fd. Make sure you download the windows-gnu version.

  • Of course, download emacs.

Extract the binaries1 from Ripgrep and fd to their respective folders and place them where you want.

  • You should have one folder for Ripgrep and another for fd.

Extract emacs and place it where you want. It does not matter where they are, we will add them to the Path later (but keep them safe and where you can remember).

Instructions

Edit system environment variables

  • Go to Control panel -> User Accounts -> Change my environment variables.

    • New, type HOME and set your C:\Users\USERNAME and OK.

    • Select Path, edit and add your C:\path\to\the\emacs\bin folder and OK.

    • Select Path, edit and add your C:\path\to\the\ripgrep folder and OK.

    • Select Path, edit and add your C:\path\to\the\fd folder and OK.

    • Click Ok.

  • We still need to add C:\Users\USERNAME\.emacs.d\bin; but first download Doom files.

Install Doom

  • Open git-bash.exe

  • Type cd ~

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

  • After the download is completed, type cd ~/.emacs.d/bin and run: ./doom install

  • If everything is fine, Doom is now installed.

  • Just in case run ./doom sync

  • Go to Control panel -> User Accounts -> Change my environment variables.

    • Select Path, edit and add C:\Users\USERNAME\.emacs.d\bin, click OK -> OK.

  • Now you can start emacs and will see the Doom dashboard!

All the icons

By default all-the-icons will not be enabled in Windows.

  • If all-the-icons is not installed. Open emacs and M-x package-install RET all-the-icons RET.

  • M-x all-the-icons-install-fonts select where to download the fonts and install them (double click -> install).

  • Restart emacs and there you go.

From one PC to another

If one of your PCs does not have internet connection or is under a firewall, you can:

  • Copy your ~/.doom.d ~/.emacs.d ripgrep fd emacs folders directly to the other PC (~/.domm.d ~/.emacs.d go in C:\Users\USERNAME)

  • Edit the system environment variables accordingly.

  • Copy and install the fonts you downloaded with all-the-icons

  • Open git-bash.exe, cd ~/.emacs.d/bin and run: ./doom sync

  • et voilà!.

Emacs server

If you use emacs server, Doom will place the server file in C:\Users\USERNAME\.emacs.d\.local\cache\server folder.

  • Go to Control panel -> User Accounts -> Change my environment variables.

    • New type EMACS_SERVER_FILE and set the file path C:\Users\USERNAME\.emacs.d\.local\cache\server\server.

    • Create a emacsclientw.exe shortcut with emacsclientw.exe -nc in target, run emacs server and emacsclientw will work.

Now, rejoice!


1

with binaries I mean the .exe

updatedupdated2020-05-242020-05-24