-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTyo-Prefs.el
168 lines (137 loc) · 6.54 KB
/
Tyo-Prefs.el
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
;; This is the Aquamacs Preferences file.
;; Add Emacs-Lisp code here that should be executed whenever
;; you start Aquamacs Emacs. If errors occur, Aquamacs will stop
;; evaluating this file and print errors in the *Messags* buffer.
;; Use this file in place of ~/.emacs (which is loaded as well.)
;; Aquamacs Emacs Starter Kit
;; http://github.com/walter/aquamacs-emacs-starter-kit
;; set the dotfiles-dir variable to this directory
(setq kitfiles-dir (concat (file-name-directory
(or (buffer-file-name) load-file-name)) "/aquamacs-emacs-starter-kit"))
;; set up our various directories to load
(add-to-list 'load-path kitfiles-dir)
(add-to-list 'load-path "~/Library/Application Support/Aquamacs Emacs/vendor/paredit/")
(require 'init)
;; -----------------
;; Awesome autocomplete
;; -----------------
(add-to-list 'load-path "~/Library/Application Support/Aquamacs Emacs/vendor/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/Library/Application Support/Aquamacs Emacs/vendor//ac-dict")
(ac-config-default)
(require 'paredit)
(autoload 'paredit-mode "paredit"
"Minor mode for pseudo-structurally editing Lisp code." t)
(add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'slime-repl-mode-hook (lambda () (paredit-mode +1)))
(add-hook 'slime-mode-hook (lambda () (paredit-mode +1)))
;; Stop SLIME's REPL from grabbing DEL,
;; which is annoying when backspacing over a '('
(defun override-slime-repl-bindings-with-paredit ()
(define-key slime-repl-mode-map
(read-kbd-macro paredit-backward-delete-key) nil))
(add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit)
;;Slime Config
(add-to-list 'load-path "~/src/slime/")
(require 'slime)
(slime-setup '(slime-repl slime-js))
;; (global-set-key [f5] 'slime-js-reload)
;; (add-hook 'js2-mode-hook
;; (lambda ()
;; (slime-js-minor-mode 1)))
;; (add-to-list 'slime-lisp-implementations '(sbcl ("sbcl")))
;;; Slime/Lisp/Paredit
(define-key slime-mode-map (kbd "C-c w") 'paredit-wrap-sexp)
(define-key slime-repl-mode-map (kbd "C-c w") 'paredit-wrap-sexp)
(require 'clojure-mode)
(defun clojure-font-lock-setup ()
(interactive)
(set (make-local-variable 'lisp-indent-function)
'clojure-indent-function)
(set (make-local-variable 'lisp-doc-string-elt-property)
'clojure-doc-string-elt)
(set (make-local-variable 'font-lock-multiline) t)
(add-to-list 'font-lock-extend-region-functions
'clojure-font-lock-extend-region-def t)
(when clojure-mode-font-lock-comment-sexp
(add-to-list 'font-lock-extend-region-functions
'clojure-font-lock-extend-region-comment t)
(make-local-variable 'clojure-font-lock-keywords)
(add-to-list 'clojure-font-lock-keywords
'clojure-font-lock-mark-comment t)
(set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil))
(setq font-lock-defaults
'(clojure-font-lock-keywords ; keywords
nil nil
(("+-*/.<>=!?$%_&~^:@" . "w")) ; syntax alist
nil
(font-lock-mark-block-function . mark-defun)
(font-lock-syntactic-face-function
. lisp-font-lock-syntactic-face-function))))
(add-hook 'slime-repl-mode-hook
(lambda ()
;; (font-lock-mode nil)
(clojure-font-lock-setup)
;; (font-lock-mode t)
))
(defadvice slime-repl-emit (after sr-emit-ad activate)
(with-current-buffer (slime-output-buffer)
(add-text-properties slime-output-start slime-output-end
'(font-lock-face slime-repl-output-face
rear-nonsticky (font-lock-face)))))
(defadvice slime-repl-insert-prompt (after sr-prompt-ad activate)
(with-current-buffer (slime-output-buffer)
(let ((inhibit-read-only t))
(add-text-properties slime-repl-prompt-start-mark (point-max)
'(font-lock-face slime-repl-prompt-face
rear-nonsticky
(slime-repl-prompt
read-only
font-lock-face
intangible))))))
(require 'rainbow-delimiters)
(autoload 'rainbow-delimiters-mode "rainbow-delimiters" t)
(add-hook 'emacs-lisp-mode-hook (lambda () (rainbow-delimiters-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (rainbow-delimiters-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (rainbow-delimiters-mode +1)))
;; (add-hook 'slime-repl-mode-hook (lambda () (rainbow-delimiters-mode +1)))
(add-hook 'slime-mode-hook (lambda () (rainbow-delimiters-mode +1)))
(require 'highlight-parentheses)
(autoload 'highlight-parentheses-mode "highlight parentheis" t)
(add-hook 'emacs-lisp-mode-hook (lambda () (highlight-parentheses-mode +1)))
(add-hook 'lisp-mode-hook (lambda () (highlight-parentheses-mode +1)))
(add-hook 'lisp-interaction-mode-hook (lambda () (highlight-parentheses-mode +1)))
;; (add-hook 'slime-repl-mode-hook (lambda () (highlight-parentheses-mode +1)))
(add-hook 'slime-mode-hook (lambda () (highlight-parentheses-mode +1)))
;;Color theme
(require 'zenburn)
(color-theme-zenburn)
;; CDT
;; (progn
;; (setq cdt-dir "/Users/adie/src/cdt")
;; (setq cdt-source-path "/Users/adie/src/zip/clojure-1.2.0/src/jvm:/Users/adie/src/zip/clojure-1.2.0/src/clj:/Users/adie/src/zip/clojure-contrib-1.2.0/src/main/clojure:")
;; (load-file (format "%s/ide/emacs/cdt.el" cdt-dir)))
;; JS2 Mode
;; (add-to-list 'load-path "~/Library/Application Support/Aquamacs Emacs/vendor/js2-mode/")
;; (autoload 'js2-mode "js2-mode" nil t)
;; (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;; YASnippet
(add-to-list 'load-path "~/Library/Application Support/Aquamacs Emacs/vendor/yasnippet-0.6.1c")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/Library/Application Support/Aquamacs Emacs/vendor/yasnippet-0.6.1c/snippets")
;; Magit
(autoload 'magit-status "magit" nil t)
(global-set-key "\C-ci" 'magit-status)
;; HAML Mode
(add-to-list 'load-path "~/Library/Application Support/Aquamacs Emacs/vendor/haml-mode")
(require 'haml-mode)
(add-hook 'haml-mode-hook
'(lambda ()
(setq indent-tabs-mode nil)
(define-key haml-mode-map "\C-m" 'newline-and-indent)))
;; Jade Mode
(add-to-list 'load-path "~/Library/Application Support/Aquamacs Emacs/vendor/jade-mode")
(require 'jade-mode)