diff options
-rw-r--r-- | .emacs | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -0,0 +1,63 @@ | |||
1 | (defun ensure-package-installed (&rest packages) | ||
2 | "Assure every package is installed, ask for installation if it’s not. | ||
3 | |||
4 | Return a list of installed packages or nil for every skipped package." | ||
5 | (mapcar | ||
6 | (lambda (package) | ||
7 | ;; (package-installed-p 'evil) | ||
8 | (if (package-installed-p package) | ||
9 | nil | ||
10 | (if (y-or-n-p (format "Package %s is missing. Install it? " package)) | ||
11 | (package-install package) | ||
12 | package))) | ||
13 | packages)) | ||
14 | |||
15 | ;; make sure to have downloaded archive description. | ||
16 | ;; Or use package-archive-contents as suggested by Nicolas Dudebout | ||
17 | (or (file-exists-p package-user-dir) | ||
18 | (package-refresh-contents)) | ||
19 | |||
20 | (require 'package) | ||
21 | (add-to-list 'package-archives | ||
22 | '("marmaled" . "http://marmalade-repo.org/packages/") t) | ||
23 | (when (< emacs-major-version 24) | ||
24 | ;; For important compatibility libraries like cl-lib | ||
25 | (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) | ||
26 | |||
27 | (ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) | ||
28 | |||
29 | ;; activate installed packages | ||
30 | (package-initialize) | ||
31 | |||
32 | (add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/") | ||
33 | (add-to-list 'load-path "/run/current-system/sw/share/emacs/site-lisp/") | ||
34 | |||
35 | (menu-bar-mode -1) | ||
36 | (scroll-bar-mode -1) | ||
37 | |||
38 | (require 'evil) | ||
39 | (evil-mode 1) | ||
40 | |||
41 | (require 'color-theme) | ||
42 | (color-theme-initialize) | ||
43 | (if (daemonp) | ||
44 | (add-hook 'after-make-frame-functions | ||
45 | (lambda (frame) | ||
46 | (with-selected-frame frame | ||
47 | (color-theme-ld-dark)))) | ||
48 | (color-theme-ld-dark) | ||
49 | ) | ||
50 | |||
51 | (global-undo-tree-mode) | ||
52 | |||
53 | (set-default-font "DejaVu Sans Mono") | ||
54 | (tool-bar-mode -1) | ||
55 | |||
56 | (global-set-key (kbd "RET") 'newline-and-indent) | ||
57 | (global-set-key (kbd "M-g") 'magit-status) | ||
58 | |||
59 | (setq backup-directory-alist `(("." . "~/.saves"))) | ||
60 | (setq delete-old-versions t | ||
61 | kept-new-versions 6 | ||
62 | kept-old-versions 2 | ||
63 | version-control t) | ||