Skip to content

Instantly share code, notes, and snippets.

@Mischi
Created October 1, 2016 17:05
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 Mischi/46a6048c91ddbdf218d900b7ed6609e6 to your computer and use it in GitHub Desktop.
Save Mischi/46a6048c91ddbdf218d900b7ed6609e6 to your computer and use it in GitHub Desktop.
(require 'package)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(setq package-enable-at-startup nil)
(package-initialize)
(defun ensure-package-installed (&rest packages)
"Assure every package is installed, ask for installation if it's not.
Return a list of installed packages or nil for every skipped package."
(mapcar
(lambda (package)
(if (package-installed-p package)
nil
(if (y-or-n-p (format "Package %s is missing. Install it? " package))
(package-install package)
package)))
packages))
;; Make sure to have downloaded archive description.
(or (file-exists-p package-user-dir)
(package-refresh-content))
;; Activate installed packages.
(package-initialize)
;; Make sure packages are installed.
(ensure-package-installed
'magit
'evil
'evil-magit
'projectile
'helm
'helm-projectile
'atom-one-dark-theme)
;; Disable backups
(setq make-backup-files nil)
(setq auto-save-default nil)
;; Load colorscheme
(load-theme 'atom-one-dark t)
;; Load and configure magit
(require 'magit)
(global-set-key (kbd "C-c g") 'magit-status)
;; Load and configure evil
(require 'evil)
(evil-mode t)
(define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up)
;; Load anf configure evil-magit
(require 'evil-magit)
;; Load and configure helm
(require 'helm-config)
(helm-mode 1)
;; Load and configure helm-projectile
(require 'helm-projectile)
(helm-projectile-on)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment