Skip to content

Instantly share code, notes, and snippets.

@harrifeng
Created April 29, 2021 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harrifeng/65be1f0e01b8e323657b38fc580fa6a1 to your computer and use it in GitHub Desktop.
Save harrifeng/65be1f0e01b8e323657b38fc580fa6a1 to your computer and use it in GitHub Desktop.
multi emacs config

Install Doom alongside other configs (with Chemacs2)

Chemacs2 is a bootloader for Emacs. It allows you to switch between multiple Emacs configurations. Here is a quick guide for setting it up with Doom Emacs as the default config:

  1. First, install Doom somewhere:
    git clone https://github.com/hlissner/doom-emacs ~/doom-emacs
    ~/doom-emacs/bin/doom install
        
  2. Move aside any existing config and install Chemacs2 as your new ~/.emacs.d:
    [ -f ~/.emacs ] && mv ~/.emacs ~/.emacs.bak
    [ -d ~/.emacs.d ] && mv ~/.emacs.d ~/.emacs.legacy
    git clone https://github.com/plexus/chemacs2.git ~/.emacs.d
        
  3. Create ~/.emacs-profiles.el with a list of your Emacs profiles. This file is structured like a .dir-locals.el file. Here is an example with Doom (as the default), Spacemacs, and Prelude:
    (("default"   . ((user-emacs-directory . "~/doom-emacs")))
     ("legacy" . ((user-emacs-directory . "~/.emacs.legacy")))
     ("spacemacs"   . ((user-emacs-directory . "~/spacemacs"))))
        

To start Emacs with a specific config, use the --with-profile option:

emacs --with-profile spacemacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment