-
Notifications
You must be signed in to change notification settings - Fork 1
/
emacs
76 lines (52 loc) · 1.76 KB
/
emacs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
; -*- mode: emacs-lisp -*-
;;; Customization in its own file
;;;
;;; This should be done early in the configuration so that the customizations
;;; get loaded. For example, load-theme stores safe themes in a custom variable.
(setq custom-file "~/.emacs.d/custom.el")
(if (file-exists-p custom-file) (load custom-file))
;;; General stuff
(ido-mode t)
(global-font-lock-mode 1)
(server-start)
(setq inhibit-splash-screen t)
(add-to-list 'load-path (expand-file-name "~/code/elisp"))
;;; package.el
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(defun package-install-if-needed (package)
"Install a package if it's missing."
(unless (package-installed-p package)
(package-refresh-contents)
(package-install package)))
;;; handy functions
(defun reload-conf ()
"Reload ~/.emacs"
(interactive)
(load-file (expand-file-name "~/.emacs")))
(transient-mark-mode 1)
;;; GUI
(tool-bar-mode -1)
(scroll-bar-mode -1)
(if (not (eq system-type 'darwin)) (menu-bar-mode -1))
;;; smex
(package-install-if-needed 'smex)
(require 'smex)
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
;;; Magit
(global-set-key (kbd "<f6>") 'magit-status)
;; Emacs Lisp
(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode-enable)
;;; Clojure
(add-hook 'clojure-mode-hook 'enable-paredit-mode)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode-enable)
;;; Local configuration
(let ((local-conf (expand-file-name "~/.emacs.d/local.el")))
(if (file-exists-p local-conf)
(load-file local-conf)))