1 ;; ~/.emacs.d/init.el (~/.emacs) |
1 ;; ~/.emacs.d/init.el (~/.emacs) |
2 ;; Luke Hoersten <[email protected]> |
2 ;; Luke Hoersten <[email protected]> |
3 |
3 |
4 |
4 |
5 ;;;; General ;;;; |
5 ;;;; General ;;;; |
6 (add-to-list 'load-path "~/.emacs.d") ; set default emacs load path |
6 (add-to-list 'load-path "~/.emacs.d") ; set default emacs load path |
|
7 (add-to-list 'load-path "~/.emacs.d/thirdparty") ; set default third party path |
7 |
8 |
8 (setq-default |
9 (setq-default |
9 ediff-split-window-function |
10 ediff-split-window-function |
10 'split-window-horizontally ; diff horizontally |
11 'split-window-horizontally ; diff horizontally |
11 x-select-enable-clipboard t ; paste from X buffer |
12 x-select-enable-clipboard t ; paste from X buffer |
12 inhibit-splash-screen t ; disable splash screen |
13 inhibit-splash-screen t ; disable splash screen |
13 truncate-lines t ; truncate, not wrap, lines |
14 truncate-lines t ; truncate, not wrap, lines |
14 indent-tabs-mode nil ; only uses spaces for indentation |
15 indent-tabs-mode nil ; only uses spaces for indentation |
15 split-width-threshold 181) ; min width to split window horizontially |
16 split-width-threshold 181 ; min width to split window horizontially |
|
17 reb-re-syntax 'string) ; use string syntax for regexp builder |
16 |
18 |
17 (put 'set-goal-column 'disabled nil) ; enable goal column setting |
19 (put 'set-goal-column 'disabled nil) ; enable goal column setting |
18 (put 'narrow-to-region 'disabled nil) ; enable hiding |
20 (put 'narrow-to-region 'disabled nil) ; enable hiding |
19 (put 'narrow-to-page 'disabled nil) |
21 (put 'narrow-to-page 'disabled nil) |
20 |
22 |
21 (menu-bar-mode -1) ; remove menu bar |
|
22 (display-time-mode t) ; show clock |
|
23 (column-number-mode t) ; show column numbers |
23 (column-number-mode t) ; show column numbers |
24 (delete-selection-mode t) ; replace highlighted text |
24 (delete-selection-mode t) ; replace highlighted text |
25 (windmove-default-keybindings) ; move between windows with shift-arrow |
25 (windmove-default-keybindings) ; move between windows with shift-arrow |
26 (fset 'yes-or-no-p 'y-or-n-p) ; replace yes/no prompts |
26 (fset 'yes-or-no-p 'y-or-n-p) ; replace yes/no prompts |
27 |
27 |
49 (progn |
49 (progn |
50 (defun get-font () |
50 (defun get-font () |
51 "Get appropriate font based on system and hostname." |
51 "Get appropriate font based on system and hostname." |
52 (cond |
52 (cond |
53 ((string-match "darwin" (emacs-version)) "Menlo-12") |
53 ((string-match "darwin" (emacs-version)) "Menlo-12") |
54 ((string-match "HoldenCaulfield" (system-name)) "monospace-7") |
54 ((string-match "HoldenCaulfield" (system-name)) "monospace-6") |
55 ((string-match "lhoersten-66113" (system-name)) "monospace-8") |
55 ((string-match "lhoersten-66113" (system-name)) "monospace-9") |
56 ("monospace-10"))) |
56 ("monospace-10"))) |
57 |
57 |
58 (tool-bar-mode -1) ; remove tool bar |
58 (tool-bar-mode -1) ; remove tool bar |
59 (scroll-bar-mode -1) ; remove scroll bar |
59 (scroll-bar-mode -1) ; remove scroll bar |
60 (visual-line-mode t) ; word wrap break on whitespace |
60 (visual-line-mode t) ; word wrap break on whitespace |
71 (global-set-key (kbd "C-c s") 'eshell) ; start shell |
71 (global-set-key (kbd "C-c s") 'eshell) ; start shell |
72 (add-hook |
72 (add-hook |
73 'eshell-mode-hook |
73 'eshell-mode-hook |
74 '(lambda () |
74 '(lambda () |
75 (setenv "TERM" "emacs") ; enable colors |
75 (setenv "TERM" "emacs") ; enable colors |
76 (setenv "PATH" (concat "~/.cabal/bin:" (getenv "PATH"))))) ; add cabal binaries |
76 (setenv "PATH" (concat "/opt/ghc7/bin:" "~/.cabal/bin:" (getenv "PATH"))))) |
77 |
77 |
78 |
78 |
79 ;;;; Mode-Specific ;;;; |
79 ;;;; Mode-Specific ;;;; |
80 |
80 |
81 ;;; linum-mode - line numbers |
81 ;;; linum-mode - line numbers |
116 tab-width 3 |
116 tab-width 3 |
117 python-indent 3 |
117 python-indent 3 |
118 indent-tabs-mode t))) |
118 indent-tabs-mode t))) |
119 |
119 |
120 ;;; haskell-mode |
120 ;;; haskell-mode |
|
121 ;; scion |
|
122 (if (file-exists-p "~/.cabal/share/scion-0.1.0.10/emacs") |
|
123 (progn |
|
124 (add-to-list 'load-path "~/.cabal/share/scion-0.1.0.10/emacs") |
|
125 (require 'scion) |
|
126 (setq scion-program "~/.cabal/bin/scion-server") |
|
127 (add-hook |
|
128 'haskell-mode-hook |
|
129 (lambda () |
|
130 (scion-mode 1) |
|
131 (scion-flycheck-on-save 1) |
|
132 (setq scion-completing-read-function 'ido-completing-read))))) |
|
133 |
121 (add-hook |
134 (add-hook |
122 'haskell-mode-hook |
135 'haskell-mode-hook |
123 (lambda () |
136 (lambda () |
124 (haskell-indentation-mode nil) |
137 (haskell-indentation-mode nil) |
125 (haskell-indent-mode t) |
138 (haskell-indent-mode t) |
126 (capitalized-words-mode t) |
139 (capitalized-words-mode t) |
127 (haskell-doc-mode t) |
140 (haskell-doc-mode t) |
128 (setq |
141 (setq |
129 haskell-font-lock-symbols 'unicode |
142 haskell-font-lock-symbols 'unicode |
130 haskell-indent-offset 4 |
143 haskell-indent-offset 4 |
131 whitespace-line-column 78)) |
144 whitespace-line-column 120)) |
132 t) ; append instead of prepend else haskell-mode overwrites these settings |
145 t) ; append instead of prepend else haskell-mode overwrites these settings |
133 |
146 |
134 ;;; org-mode |
147 ;;; org-mode |
135 (add-hook |
148 (add-hook |
136 'org-mode-hook |
149 'org-mode-hook |
157 (ibuffer-switch-to-saved-filter-groups "default"))) |
170 (ibuffer-switch-to-saved-filter-groups "default"))) |
158 |
171 |
159 |
172 |
160 ;;;; Requires ;;;; |
173 ;;;; Requires ;;;; |
161 |
174 |
162 (require 'hoersten-align-with-spaces) ; use only spaces for alignment |
175 (require 'hoersten-c-style) ; load c specific lisp |
163 (require 'hoersten-pastebin-region) ; send selected text to pastebin |
176 (require 'align-with-spaces) ; use only spaces for alignment |
164 (require 'hoersten-c-style) ; load c specific lisp |
177 (require 'pastebin-region) ; send selected text to pastebin |
165 (require 'vala-mode) ; vala programming language |
178 (require 'move-line) ; move line up or down |
166 (require 'move-line) ; move line up or down |
179 (require 'vala-mode) ; vala programming language |
167 |
180 |
168 ;;; pretty-mode - unicode character replacement |
181 ;;; pretty-mode - unicode character replacement |
169 (require 'pretty-mode) |
182 (require 'pretty-mode) |
170 (global-pretty-mode t) |
183 (global-pretty-mode t) |
171 |
184 |
172 ;;; yasnippets |
185 ;;; yasnippets |
173 (add-to-list 'load-path "~/.emacs.d/yasnippet") |
186 (add-to-list 'load-path "~/.emacs.d/thirdparty/yasnippet") |
174 (require 'yasnippet) |
187 (require 'yasnippet) |
175 (yas/initialize) |
188 (yas/initialize) |
176 (yas/load-directory "~/.emacs.d/yasnippet/snippets") |
189 (yas/load-directory "~/.emacs.d/thirdparty/yasnippet/snippets") |
177 (setq-default yas/prompt-functions '(yas/ido-prompt yas/dropdown-prompt)) ; use ido for multiple snippets |
190 (setq-default yas/prompt-functions '(yas/ido-prompt yas/dropdown-prompt)) ; use ido for multiple snippets |
178 |
191 |
179 ;;; zencoding-mode - html |
192 ;;; zencoding-mode - html |
180 (require 'zencoding-mode) |
193 (require 'zencoding-mode) |
181 (add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes |
194 (add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes |