-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_emacs
289 lines (240 loc) · 9.19 KB
/
dot_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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
(defvar *emacs-load-start* (current-time))
;; do not display a splash screen on startup
(setq inhibit-splash-screen t)
;; set system checks
(defconst win32p
(eq system-type 'windows-nt)
"Are we running on a WinTel system?")
(defconst cygwinp
(eq system-type 'cygwin)
"Are we running on a WinTel cygwin system?")
(defconst linuxp
(or (eq system-type 'gnu/linux)
(eq system-type 'linux))
"Are we running on a GNU/Linux system?")
(defconst unixp
(or linuxp
(eq system-type 'usg-unix-v)
(eq system-type 'berkeley-unix))
"Are we running unix")
(defconst linux-x-p
(and window-system linuxp)
"Are we running under X on a GNU/Linux system?")
(defconst xemacsp (featurep 'xemacs)
"Are we running XEmacs?")
(defconst emacs>=21p (and (not xemacsp) (or (= emacs-major-version 21) (= emacs-major-version 22)))
"Are we running GNU Emacs 21 or above?")
;; Add the given path to the load-path variable.
(defun add-to-load-path (path-string)
(message (format "Passed %S..." path-string))
(if (stringp path-string)
(when (file-exists-p path-string)
(message (format "Adding %S to load-path..." path-string))
(add-to-list 'load-path (expand-file-name path-string)))
(crs-add-to-load-path (car path-string))
(if (cdr path-string)
(crs-add-to-load-path (cdr path-string)))))
(defun add-to-load-path-if-exists (dir)
(if (file-exists-p (expand-file-name dir))
(add-to-load-path (expand-file-name dir))))
(add-to-load-path-if-exists "~/.emacs.d")
(add-to-load-path-if-exists "~/.emacslisp")
(add-to-load-path-if-exists "~/.emacslisp/python-mode")
(add-to-load-path-if-exists "~/.emacslisp/rails")
(add-to-load-path-if-exists "~/.emacslisp/color-theme")
(add-to-load-path-if-exists "~/.emacslisp/semantic")
(add-to-load-path-if-exists "~/.emacslisp/eieio")
(add-to-load-path-if-exists "~/.emacslisp/speedbar")
(add-to-load-path-if-exists "~/.emacslisp/w3m")
(add-to-load-path-if-exists "~/.emacslisp/vm")
(add-to-load-path-if-exists "~/.emacslisp/ecb")
(add-to-load-path-if-exists "~/.emacslisp/muse")
(add-to-load-path-if-exists "~/.emacslisp/planner")
(add-to-load-path-if-exists "~/.emacslisp/remember")
(add-to-load-path-if-exists "~/.emacslisp/git-emacs")
(add-to-load-path-if-exists "~/.emacslisp/ruby")
(add-to-load-path-if-exists "~/.emacslisp/rinari")
(add-to-load-path-if-exists "~/.emacslisp/org")
(add-to-load-path-if-exists "~/.emacslisp/elisp_behave")
(add-to-load-path-if-exists "~/.emacslisp/icicles")
(add-to-load-path-if-exists "~/.emacslisp/magit")
(setq semantic-load-turn-everything-on t)
(require 'browse-kill-ring)
(require 'php-mode)
(require 'javascript-mode)
(require 'python-mode)
(require 'ruby-mode)
(require 'inf-ruby)
(require 'snippet)
(require 'rails)
(require 'mode-compile)
(require 'rspec-mode)
(require 'semantic-load)
;;(require 'w3m-util)
;;(require 'w3m)
;;(load "mail")
(require 'ecb)
(require 'css-mode)
(require 'anything)
(require 'haml-mode)
(require 'sass-mode)
(require 'toggle)
(require 'rinari)
(require 'remember-autoloads)
(require 'my-snippets)
(require 'scratch)
(if (file-exists-p "~/.emacslisp/my-identity.el")
(require 'my-identity))
(require 'pastie)
(require 'autotest)
(require 'erc)
(require 'git-emacs)
(require 'org)
(require 'htmlize)
(require 'tabbar)
(require 'rcodetools)
(require 'icicles-rcodetools)
(require 'untabify-file)
(require 'magit)
(require 'yasnippet-bundle)
(yas/initialize)
;(load "my-planner")
(load "my-org")
(setq rails-enable-ruby-electric nil)
(setq ri-ruby-script (concat (getenv "HOME") "/.emacslisp/ruby/ri-emacs.rb"))
(autoload 'ri (concat (getenv "HOME") "/.emacslisp/ruby/ri-ruby.el") nil t)
(setq ruby-electric-matching-delimeter-alist nil)
(setq auto-mode-alist
(cons '("\\.css\\'" . css-mode) auto-mode-alist))
(setq cssm-indent-function #'cssm-c-style-indenter)
(global-set-key "\C-c\C-f" 'anything)
(autoload 'speedbar-frame-mode "speedbar" "Popup a speedbar frame" t)
(autoload 'speedbar-get-focus "speedbar" "Jump to speedbar frame" t)
(ido-mode t)
;;(setq ido-enable-prefix nil)
(setq ido-enable-flex-matching t)
(setq c-basic-offset 4)
(defun try-complete-abbrev (old)
(if (expand-abbrev) t nil))
(setq hippie-expand-try-functions-list
'(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
(add-to-list 'auto-mode-alist '("\\.js\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.module\\'" . php-mode))
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rjs\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rhtml\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.dryml\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("sake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(add-to-list 'auto-mode-alist '("\\dot_emacs\\'" . emacs-lisp-mode))
(tool-bar-mode 0)
(menu-bar-mode 1)
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(global-font-lock-mode t)
(setq lisp-indent-offset 2)
;; Ruby
(defun ruby-eval-buffer () (interactive)
"Evaluate the buffer with ruby."
(shell-command-on-region (point-min) (point-max) "ruby"))
(require 'color-theme)
;;(color-theme-initialize)
(require 'psvn)
(setq svn-status-verbose nil)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ecb-options-version "2.32")
'(ecb-wget-setup (quote cons))
'(ecb-tip-of-the-day nil)
'(ecb-other-window-behavior 'only-edit)
'(ecb-windows-width 0.18)
'(ecb-compile-window-height 5)
'(org-agenda-files (quote ("~/created/org/todo.org")))
'(org-agenda-ndays 7)
'(org-agenda-show-all-dates t)
'(org-agenda-skip-deadline-if-done t)
'(org-agenda-skip-scheduled-if-done t)
'(org-agenda-start-on-weekday nil)
'(org-deadline-warning-days 14)
'(org-default-notes-file "~/created/org/notes.org")
'(org-reverse-note-order t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "black" :foreground "#c0c0c0" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 100 :width normal))))
'(flymake-errline ((((class color)) (:background "DarkRed"))))
'(flymake-warnline ((((class color)) (:background "DarkBlue")))))
(global-set-key "\C-c e" 'ecb-activate)
(define-key isearch-mode-map (kbd "C-o")
(lambda ()
(interactive)
(let ((case-fold-search isearch-case-fold-search))
(occur (if isearch-regexp isearch-string
(regexp-quote isearch-string))))))
(require 'uniquify)
(setq uniquify-buffer-name-style 'reverse)
(setq uniquify-separator "|")
(setq uniquify-after-kill-buffer-p t) ; rename after killing uniquified
(setq uniquify-ignore-buffers-re "^\\*") ; don't muck with special buffers
(server-start)
;(plan)
;(delete-other-windows)
(when (boundp 'aquamacs-version)
(emulate-mac-british-keyboard-mode t)
(setq initial-frame-alist '((background-color . "black") (left . 50) ))
(setq default-frame-alist '((background-color . "black") (left . 0) (width . 141) (height . 44)))
(aquamacs-styles-mode 0)
(one-buffer-one-frame-mode 0)
(smart-frame-positioning-mode 0)
(define-key osx-key-mode-map (kbd "A-w") 'kill-ring-save) ;; I don't like how A-w kills my buffer so rebind it to something innocent
)
(message "My .emacs loaded in %ds" (destructuring-bind (hi lo ms) (current-time)
(- (+ hi lo) (+ (first *emacs-load-start*) (second *emacs-load-start*)))))
(fset 'it-start
[?\C-e ? ?d ?o return ?e ?n ?d return ?\C-p tab ?\C-a return ?\C-p tab])
(fset 'it-pend
[?\C-w return up tab ?p ?e ?d backspace ?n ?d ?i ?n ?g ? ?d ?o return ?e ?n ?d ?\C-a tab ?\C-a return up ?\C-y escape ?\C-\\ ?\C-k ?\C-n ?\C-a ?\C- ?\C-r ?p ?e ?n ?d ?i ?n ?g ?\C-a])
(fset 'it-unpend
[?\C-w escape ?x ?s ?w ?i ?t ?c ?h ?- ?t ?o ?- ?b ?u ?f ?f ?e ?r return ?d ?o ?u ?n ?p ?e ?n ?d return ?\C-y up ?\C-k ?\C-k escape ?< ?\C-k ?\C-k ?\C- escape ?> ?\C-w ?\C-x ?k return ?\C-y escape ?\C-\\])
(tabbar-mode t)
(global-set-key [(control shift tab)] 'tabbar-backward)
(global-set-key [(control tab)] 'tabbar-forward)
(defun indent-buffer ()
(interactive)
(save-excursion)
(indent-region (point-min) (point-max)))
(defun open-line-at-end ()
(interactive)
(move-end-of-line 1)
(open-line 1)
(next-line)
(indent-for-tab-command))
(global-set-key "\C-c\C-l" 'revert-buffer)
(global-set-key "\C-o" 'open-line-at-end)
(require 'ansi-color)
(org-agenda-list)
;;(message "bla1")
(defun mycolor ()
(interactive)
(load "color-theme-tomtt"))
(mycolor)
;;(message "bla2")
;; light
;(color-theme-high-contrast)
;; dark
;(color-theme-hober)
;; dark with green text
;(color-theme-euphoria)
;; dark bold constructs
;(color-theme-renegade)
;; because you cannea do C-x # on a uk mac in aquamacs
(global-set-key "\C-x\\" 'server-edit)