(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 (progn (color-theme-dark-laptop) (keychain-refresh-environment) )))) (color-theme-dark-laptop) ) (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) ) ) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(ispell-alternate-dictionary nil) '(ispell-dictionary "en_GB") '(ispell-extra-args (quote ("--data-dir" "/home/gkleen/.nix-profile/lib/aspell"))) '(ispell-program-name "aspell")) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )