summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-11-03 13:26:44 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2015-11-03 13:26:44 +0100
commit269f143489fa77200799ed0e1199762733d86252 (patch)
treee25add6ea7bd0a50dc8370653b10a785c5b9e6d0 /.emacs
parent6ef619c9e351d7a3a9d066c67ede58e5f4c31c18 (diff)
parent48cd5862c2982ec6f48d086e8683d486588e3f4f (diff)
downloaddotfiles-269f143489fa77200799ed0e1199762733d86252.tar
dotfiles-269f143489fa77200799ed0e1199762733d86252.tar.gz
dotfiles-269f143489fa77200799ed0e1199762733d86252.tar.bz2
dotfiles-269f143489fa77200799ed0e1199762733d86252.tar.xz
dotfiles-269f143489fa77200799ed0e1199762733d86252.zip
Merge branch 'master' of git.yggdrasil.li:dotfiles
Diffstat (limited to '.emacs')
-rw-r--r--.emacs82
1 files changed, 82 insertions, 0 deletions
diff --git a/.emacs b/.emacs
new file mode 100644
index 0000000..c35c552
--- /dev/null
+++ b/.emacs
@@ -0,0 +1,82 @@
1(require 'package)
2
3(add-to-list 'package-archives
4 '("marmaled" . "http://marmalade-repo.org/packages/") t)
5(add-to-list 'package-archives
6 '("melpa" . "http://melpa.org/packages/"))
7(when (< emacs-major-version 24)
8 ;; For important compatibility libraries like cl-lib
9 (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
10
11(package-initialize)
12
13(defun ensure-package-installed (&rest packages)
14 "Assure every package is installed, ask for installation if it’s not.
15
16Return a list of installed packages or nil for every skipped package."
17 (mapcar
18 (lambda (package)
19 ;; (package-installed-p 'evil)
20 (if (package-installed-p package)
21 nil
22 (if (y-or-n-p (format "Package %s is missing. Install it? " package))
23 (package-install package)
24 package)))
25 packages))
26
27;; make sure to have downloaded archive description.
28;; Or use package-archive-contents as suggested by Nicolas Dudebout
29(or (file-exists-p package-user-dir)
30 (package-refresh-contents))
31
32(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode 'keychain-environment 'nix-mode 'mic-paren)
33
34(package-initialize)
35
36(add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/")
37(add-to-list 'load-path "/run/current-system/sw/share/emacs/site-lisp/")
38
39(menu-bar-mode -1)
40(scroll-bar-mode -1)
41
42(require 'evil)
43(evil-mode 1)
44
45(require 'color-theme)
46(color-theme-initialize)
47(if (daemonp)
48 (add-hook 'after-make-frame-functions
49 (lambda (frame)
50 (with-selected-frame frame
51 (color-theme-ld-dark))))
52 (color-theme-ld-dark)
53 )
54
55(global-undo-tree-mode)
56
57(set-default-font "DejaVu Sans Mono")
58(tool-bar-mode -1)
59
60(global-set-key (kbd "RET") 'newline-and-indent)
61(global-set-key (kbd "M-g") 'magit-status)
62
63(setq backup-directory-alist `(("." . "~/.saves")))
64(setq delete-old-versions t
65 kept-new-versions 6
66 kept-old-versions 2
67 version-control t)
68
69(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
70(eval-after-load "haskell-mode"
71 '(progn
72 (define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-lift)
73 (define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right)))
74
75(custom-set-variables
76 '(haskell-font-lock-symbols t))
77(add-hook 'haskell-mode-hook
78 (custom-set-faces
79 '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold))))
80 '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold))))
81 )
82 )