(require 'package) (add-to-list 'package-archives '("marmaled" . "http://marmalade-repo.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (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) ;; (package-installed-p 'evil) (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 use package-archive-contents as suggested by Nicolas Dudebout (or (file-exists-p package-user-dir) (package-refresh-contents)) (ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode 'keychain-environment 'nix-mode 'mic-paren) (package-initialize) (add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/") (add-to-list 'load-path "/run/current-system/sw/share/emacs/site-lisp/") (menu-bar-mode -1) (scroll-bar-mode -1) (require 'evil) (evil-mode 1) (require 'color-theme) (color-theme-initialize) (if (daemonp) (add-hook 'after-make-frame-functions (lambda (frame) (with-selected-frame frame (color-theme-ld-dark)))) (color-theme-ld-dark) ) (global-undo-tree-mode) (set-default-font "DejaVu Sans Mono") (tool-bar-mode -1) (global-set-key (kbd "RET") 'newline-and-indent) (global-set-key (kbd "M-g") 'magit-status) (setq backup-directory-alist `(("." . "~/.saves"))) (setq delete-old-versions t kept-new-versions 6 kept-old-versions 2 version-control t) (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) (eval-after-load "haskell-mode" '(progn (define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-lift) (define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right) (setq haskell-font-lock-symbols nil) (custom-set-faces '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) ) ) )