Spacemacs Setup on Windows

February 2017 ยท 3 minute read

What is spacemacs?

Spacemacs is an opinionated community-driven emacs distribution setup around evil-mode to be easily used with vim keybindings, or just plain emacs. More information can be found on the project github here: https://github.com/syl20bnr/spacemacs.

Why spacemacs?

I discovered spacemacs looking for a more efficient way to take notes. My criteria was this:

At first I began hunting for a vim plugin, but then I discovered Org-mode and decided to give spacemacs a try after that. I quickly fell in love with power of org-mode.

Setup

Getting emacs/spacemacs installed and running properly on Windows took a bit of hunting and fiddling with a lack of up to date documentation. Here are the steps that I have followed to setup spacemacs on multiple 64 bit machines.

Install base Emacs

Set the Windows environment variables for Emacs

Optional but reccomended steps for setting up an Emacs shortcut

  1. Create a shortcut icon for C:\Emacs\bin\runemacs.exe and place it in: C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
  2. Set the target of the shortcut to be: C:\Emacs\bin\emacsclientw.exe --alternate-editor="C:\Emacs\bin\runemacs.exe" -c

This ensures that the ‘server’ for emacs is started once and subsequently the client will be used for new instances so only one primary emacs process will be running at any given time.

Install Spacemacs

  1. In the home directory run the command: git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
  2. Launch emacs and wait until spacemacs loads up. Choose your setup and spacemacs will begun downloading base packages.
  3. Modify the .spacemacs config that is created in the home directory or copy & paste your currently existing one.

Getting the spell checker working

Instructions can be found here: https://www.emacswiki.org/emacs/AspellWindows

  1. Install Aspell from here
    • It should install to this path: C:\Program Files (x86)\Aspell
  2. Choose relevant dictionaries to install alongside it and install them when prompted during the process.
  3. Add the following to the windows env Path: C:\Program Files (x86)\Aspell\bin
  4. Add the following line to the .spacemacs userconfig, replacing ‘American’ with your dictionary choice: (setq ispell-dictionary "american")
  5. To disable spellcheker by default and only run on command add this to your .spacemacs
(setq-default dotspacemacs-configuration-layers '((spell-checking :variables spell-checking-enable-by-default nil)))

Bug Fix

The only issue I’ve dealt with repeatedly is that on occasion Emacs begins to launch new server instances instead of children. This may occur from an error in your .spacemacs config or possibly a layer that is installed.

If your own config contains no errors, the quick fix is to reset you spacemacs and redownload all packages:

git reset --hard origin/master git clean -fdx