summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-07-15 21:35:49 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-07-15 21:35:49 +0200
commit8de3d902ae7df10c3444cf4b2993d132c3efaea1 (patch)
tree9ea0b572f729142676443a381b3c1912913f5710
parent92fdd2b1e4c24066f777c4f1a77e277642accb4b (diff)
downloaddotfiles-8de3d902ae7df10c3444cf4b2993d132c3efaea1.tar
dotfiles-8de3d902ae7df10c3444cf4b2993d132c3efaea1.tar.gz
dotfiles-8de3d902ae7df10c3444cf4b2993d132c3efaea1.tar.bz2
dotfiles-8de3d902ae7df10c3444cf4b2993d132c3efaea1.tar.xz
dotfiles-8de3d902ae7df10c3444cf4b2993d132c3efaea1.zip
First try at .emacs
-rw-r--r--.emacs63
1 files changed, 63 insertions, 0 deletions
diff --git a/.emacs b/.emacs
new file mode 100644
index 0000000..4bb3336
--- /dev/null
+++ b/.emacs
@@ -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
4Return 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)