2 min read

Spacemacs on WSL

Running “evil” Spacemacs on Windows under Debian (or Ubuntu) is a pleasant Emacs experience—for those who like Emacs, or Vim, or both. Just a few evil gotchas and caveats exist on WSL, Windows Subsystem for Linux.

TL; DR

The short version for the impatient like me.

sudo apt-get update
sudo apt-get upgrade

# for Debian "bullseye" (https://www.debian.org/releases/bullseye/)
sudo apt-get install software-properties-common gnupg2

# https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get install emacs28

# Powerline fonts
git clone https://github.com/powerline/fonts.git
fonts/install.sh
rm -rf fonts/

sudo apt-get install fonts-symbola

git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d

# Spacemacs, go for launch!
emacs

Fresh distributions typically require an update and upgrade in order to refresh the signing certificates used when installing Emacs package archives. Your Linux flavour needs the add-apt-repository Python tool; the APT software-properties-common package installs it, if not already installed. GPG for PPA signing also required.

You Need Emacs 27 or Above

Versions below the minimum required for Spacemacs, typically version 24 for example, is the default installation of Emacs packaged with Ubuntu and its Debian-oriented flavours. Install version 27.1 via PPA.

Install Powerline Fonts

Optionally clone the nice-to-have fancy fonts and install, as above. Also install fonts-symbola using APT for the correct minor-mode status symbols.

Clone the Spacemacs Directory

Clone Spacemacs’ .emacs.d and launch Emacs.

Edit your ~/.spacemacs start-up Lisp. Change the default font to its “for Powerline” variant and presto.

   dotspacemacs-default-font '("Source Code Pro for Powerline"
                               :size 10.0
                               :weight normal
                               :width normal)

Windows Native

On Windows with Chocolatey, install using:

choco install emacs

You get Emacs \(28.2\)—at the time of writing. The .emacs.d folder lives in APPDATA or AppData\Roaming on Windows. Install Spacemacs using:

git clone https://github.com/syl20bnr/spacemacs $env:APPDATA/.emacs.d

You might see “File error: Creating pipe, Too many open files” when Spacemacs installs packages. Kill using Task Manager and restart; Spacemacs will resume installation from where it left off; mileage may vary.