Skip to content

Instantly share code, notes, and snippets.

@nevsan
Created October 24, 2016 03:33
Show Gist options
  • Save nevsan/18f6d8bddb357634d3d3e296b497eeb5 to your computer and use it in GitHub Desktop.
Save nevsan/18f6d8bddb357634d3d3e296b497eeb5 to your computer and use it in GitHub Desktop.
Initialize Spacemacs inside your own .emacs.d
;;; init.el -- Main Emacs Initialization File
;;; Commentary:
;;; This file is loaded first by emacs if '~/.emacs' does not exist.
;;; Code:
;; Record the current value of 'user-emacs-directory' since we will be
;; overriding it later for spacemacs.
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
;(package-initialize)
(defconst emacs-dir user-emacs-directory
"Emacs configuration directory (pre-spacemacs).")
;; Tell spacemacs to find the configuration in the local spacemacs.d, which
;; keeps this repository self-contained (no need for ~/.spacemacs to be linked)
(setenv "SPACEMACSDIR" (concat emacs-dir "spacemacs.d/"))
;; Override user-emacs-directory so that spacemacs can load itself the way that
;; it wants.
(setq user-emacs-directory (concat emacs-dir "spacemacs/"))
;; Now load spacemacs.
(load (concat user-emacs-directory "init.el"))
;;; init.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment