-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdotemacs
477 lines (388 loc) · 14.9 KB
/
dotemacs
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
(add-to-list 'load-path "~/.emacs.d")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(setq indent-tabs-mode nil)
(setq-default tab-width 2)
(iswitchb-mode)
(if (boundp 'tool-bar-mode)
(tool-bar-mode))
(global-set-key [?\M-\]] 'kill-paragraph)
(global-set-key [?\M-3] 'call-last-kbd-macro)
(global-set-key [?\M-9] 'delete-trailing-whitespace)
(global-set-key [?\C-j] 'comment-indent-new-line)
(put 'downcase-region 'disabled nil)
(add-to-list 'load-path "~/.emacs.d/slime")
(setq inferior-lisp-program "/opt/local/bin/sbcl")
(require 'slime)
(slime-setup)
(add-to-list 'load-path "~/.emacs.d/git-emacs")
(require 'git-emacs)
(load "~/.emacs.d/haskell-mode/haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent)
(setq auto-mode-alist
(append
'(("\\.pl$" . prolog-mode))
auto-mode-alist))
(setq prolog-program-name "swipl")
;(setq prolog-consult-string "[user].\n")
;; ---------------------------------------- START C/C++/D programming
(setq c-default-style "linux"
c-basic-offset 2)
(add-to-list 'load-path "~/.emacs.d/cc-mode-5.31.3")
(require 'cc-mode)
(global-set-key [C-c C-l] 'compile)
(autoload 'awk-mode "cc-mode" nil t)
(add-to-list 'load-path "~/.emacs.d/d-mode")
(autoload 'd-mode "d-mode"
"Major mode for editing D code." t)
;; arg!
(setq auto-mode-alist (cons '( "\\.d\\'" . c++-mode) auto-mode-alist ))
(autoload 'dlint-minor-mode "dlint" nil t)
(add-hook 'd-mode-hook (lambda () (dlint-minor-mode 1)))
;; ---------------------------------------- END C/C++/D programming
(load "~/.emacs.d/mmm-mako.el")
(add-to-list 'auto-mode-alist '("\\.mako\\'" . html-mode))
(mmm-add-mode-ext-class 'html-mode "\\.mako\\'" 'mako)
(defun word-count nil "Count words in buffer" (interactive)
(shell-command-on-region (point-min) (point-max) "wc -w"))
(autoload 'camelCase-mode "camelCase-mode" nil t)
(setq load-path (cons "~/.emacs.d/emacs-rails" load-path))
(require 'rails)
(add-hook 'ruby-mode-hook '(lambda () (camelCase-mode 1)))
(add-hook 'python-mode-hook '(lambda () (camelCase-mode 1)))
(require 'yaml-mode)
;; file last-edited-point saving
(require 'saveplace)
(setq-default save-place t)
(defvar save-place-file (convert-standard-filename "~/.emacs.d/.saveplace")
"*Name of the file that records `save-place-alist' value.")
;; minibuffer history saving
;(setq savehist-file "~/.emacs.d/.savehist")
;(savehist-mode 1)
;; open file saving
;;(require 'save-visited-files)
;;(open-visited-files)
;;(save-visited-files-mode 1)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(require 'tramp)
(setq tramp-default-method "ssh")
;; /service2.retailinkjet.com:/home/dls/api.retailinkjet.com
;(autoload 'moz-minor-mode "moz" "Mozilla Minor and Inferior Mozilla Modes" t)
(add-hook 'javascript-mode-hook 'javascript-custom-setup)
(defun javascript-custom-setup ()
(moz-minor-mode 1))
(require 'haml-mode)
(load "typing-speed.el")
(add-to-list 'load-path "~/.emacs.d/org-6.34c")
(add-to-list 'load-path "~/.emacs.d/org-6.34c/lisp")
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(setq org-log-done t)
(setq org-agenda-files (list "~/org/etc.org" "~/org/log.org"))
(setq org-mobile-inbox-for-pull "~/org/flagged.org")
(setq org-mobile-directory "~/Dropbox/MobileOrg")
;;; --- trac integration
;; (require 'trac-wiki)
;; (trac-wiki-define-project "project-trac"
;; "https://trac.project.com/trac"; "username")
;; (autoload 'trac-wiki "trac-wiki" "Trac wiki editing entry-point." t)
;; ;;; - start orgstruct minor mode when trac-wiki is loaded.
;; (add-hook 'trac-wiki-mode-hook 'turn-on-orgstruct)
(add-hook 'dired-load-hook
(function (lambda ()
(load "dired-x")
;; Set global variables here. For example:
;; (setq dired-guess-shell-gnutar "gtar")
)))
(add-hook 'dired-mode-hook
(function (lambda ()
;; Set buffer-local variables here. For example:
(dired-omit-mode 1)
)))
;;(load-file "~/.emacs.d/dvc-snapshot/++build/dvc-load.el")
(add-to-list 'load-path "~/.emacs.d/epg")
(require 'epa-file)
(epa-file-enable)
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
(require 'color-theme)
(require 'color-theme-autoloads)
(load "~/.emacs.d/color-theme-6.6.0/themes/color-theme-library.el")
;; (color-theme-gnome)
;; (color-theme-blue-gnus)
;; (color-theme-dark-gnus)
;; (color-theme-blue-eshell)
;; (color-theme-salmon-font-lock)
;; (color-theme-dark-font-lock)
;; (color-theme-dark-info)
;; (color-theme-gnome2)
;; (color-theme-simple-1)
;; (color-theme-jonadabian)
;; (color-theme-ryerson)
;; (color-theme-wheat)
;; (color-theme-standard)
;; (color-theme-fischmeister)
;; (color-theme-sitaramv-solaris)
;; (color-theme-sitaramv-nt)
;; (color-theme-billw)
;; (color-theme-retro)
;; (color-theme-retro-orange)
;; (color-theme-subtle-hacker)
;; (color-theme-pok-wog)
;; (color-theme-pok-wob)
;; (color-theme-blue-sea)
;; (color-theme-rotor)
;; (color-theme-pierson)
;; (color-theme-xemacs)
;; (color-theme-jsc-light)
;; (color-theme-jsc-dark)
;; (color-theme-greiner)
;; (color-theme-jb-simple)
;; (color-theme-beige-diff)
;; (color-theme-standard-ediff)
;; (color-theme-beige-eshell)
;; (color-theme-goldenrod)
;; (color-theme-ramangalahy)
;; (color-theme-raspopovic)
;; (color-theme-taylor)
;; (color-theme-marquardt)
;; (color-theme-parus)
;; (color-theme-high-contrast)
;; (color-theme-infodoc)
;; (color-theme-classic)
;; (color-theme-scintilla)
;; (color-theme-gtk-ide)
;; (color-theme-midnight)
;; (color-theme-jedit-grey)
;; (color-theme-snow)
;; (color-theme-montz)
;; (color-theme-aalto-light)
;; (color-theme-aalto-dark)
;; (color-theme-blippblopp)
;; (color-theme-hober)
;; (color-theme-bharadwaj)
;; (color-theme-oswald)
;; (color-theme-salmon-diff)
;; (color-theme-robin-hood)
;; (color-theme-snowish)
;; (color-theme-dark-laptop)
;; (color-theme-taming-mr-arneson)
;; (color-theme-digital-ofs1)
;; (color-theme-mistyday)
;; (color-theme-marine)
;; (color-theme-blue-erc)
;; (color-theme-dark-erc)
;; (color-theme-subtle-blue)
;; (color-theme-dark-blue)
;; (color-theme-jonadabian-slate)
;; (color-theme-gray1)
;; (color-theme-word-perfect)
;; (color-theme-emacs-21)
;; (color-theme-jsc-light2)
;; (color-theme-ld-dark)
;; (color-theme-deep-blue)
;; (color-theme-kingsajz)
;; (color-theme-comidia)
;; (color-theme-katester)
;; (color-theme-arjen)
;; (color-theme-tty-dark)
;; (color-theme-aliceblue)
;; (color-theme-black-on-gray)
;; (color-theme-dark-blue2)
;; (color-theme-blue-mood)
;; (color-theme-euphoria)
;; (color-theme-resolve)
;; (color-theme-xp)
;; (color-theme-gray30)
;; (color-theme-dark-green)
;; (color-theme-whateveryouwant)
;; (color-theme-bharadwaj-slate)
;; (color-theme-lethe)
;; (color-theme-shaman)
;; (color-theme-emacs-nw)
;; (color-theme-late-night)
;; (color-theme-clarity)
;; (color-theme-andreas)
;; (color-theme-charcoal-black)
;; (color-theme-vim-colors)
;; (color-theme-calm-forest)
;; (color-theme-lawrence)
;; (color-theme-matrix)
;; (color-theme-feng-shui)
;; (color-theme-renegade)
(color-theme-calm-forest)
(color-theme-dark-laptop)
;; lethe sets up better non-text highlighting that tty-dark doesn't overwrite
;;(color-theme-lethe)
;;(color-theme-clarity)
;;(require 'color-theme-billc)
;;(color-theme-billc)
(defun color-theme-djcb-dark ()
"dark color theme created by djcb, Jan. 2009."
(interactive)
(color-theme-install
'(color-theme-djcb-dark
((foreground-color . "#a9eadf")
(background-color . "black")
(background-mode . dark))
(bold ((t (:bold t))))
(bold-italic ((t (:italic t :bold t))))
(default ((t (nil))))
(font-lock-builtin-face ((t (:italic t :foreground "#a96da0"))))
(font-lock-comment-face ((t (:italic t :foreground "#bbbbbb"))))
(font-lock-comment-delimiter-face ((t (:foreground "#666666"))))
(font-lock-constant-face ((t (:bold t :foreground "#197b6e"))))
(font-lock-doc-string-face ((t (:foreground "#3041c4"))))
(font-lock-doc-face ((t (:foreground "gray"))))
(font-lock-reference-face ((t (:foreground "white"))))
(font-lock-function-name-face ((t (:foreground "#356da0"))))
(font-lock-keyword-face ((t (:bold t :foreground "#bcf0f1"))))
(font-lock-preprocessor-face ((t (:foreground "#e3ea94"))))
(font-lock-string-face ((t (:foreground "#ffffff"))))
(font-lock-type-face ((t (:bold t :foreground "#364498"))))
(font-lock-variable-name-face ((t (:foreground "#7685de"))))
(font-lock-warning-face ((t (:bold t :italic nil :underline nil
:foreground "yellow"))))
(hl-line ((t (:background "#112233"))))
(mode-line ((t (:foreground "#ffffff" :background "#333333"))))
(region ((t (:foreground nil :background "#555555"))))
(show-paren-match-face ((t (:bold t :foreground "#ffffff"
:background "#050505")))))))
(require 'pretty-symbols)
(add-hook 'haskell-mode-hook 'pretty-symbols-mode)
(setq swapping-buffer nil)
(setq swapping-window nil)
(defun swap-buffers-in-windows ()
"Swap buffers between two windows"
(interactive)
(if (and swapping-window
swapping-buffer)
(let ((this-buffer (current-buffer))
(this-window (selected-window)))
(if (and (window-live-p swapping-window)
(buffer-live-p swapping-buffer))
(progn (switch-to-buffer swapping-buffer)
(select-window swapping-window)
(switch-to-buffer this-buffer)
(select-window this-window)
(message "Swapped buffers."))
(message "Old buffer/window killed. Aborting."))
(setq swapping-buffer nil)
(setq swapping-window nil))
(progn
(setq swapping-buffer (current-buffer))
(setq swapping-window (selected-window))
(message "Buffer and window marked for swapping."))))
(global-set-key (kbd "C-c p") 'swap-buffers-in-windows)
(require 'window-number)
(window-number-mode)
(scroll-bar-mode)
;;(server-start)
(require 'org-protocol)
(set-face-attribute 'default nil :height 80)
(require 'js2-mode)
(add-hook 'js2-mode-hook (lambda ()
(js2-leave-mirror-mode)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(setq js2-basic-offset 2)
(setq js2-enter-indents-newline t)
(setq js2-bounce-indent-p t)
(setq js2-mode-escape-quotes nil)))
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;; I hate tabs
(setq-default indent-tabs-mode nil)
(add-to-list 'load-path "~/.emacs.d/tuareg-mode")
(setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
(autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
(autoload 'camldebug "camldebug" "Run the Caml debugger" t)
(require 'sass-mode)
;;; ================================================================ SCALA START
;;; outline taken from http://scala.sygneca.com/tools/emacs
(add-to-list 'load-path "~/.emacs.d/scala-mode")
(load "scala-mode-auto.el")
(defun scala-turnoff-indent-tabs-mode ()
(setq indent-tabs-mode nil))
;; scala mode hooks
(add-hook 'scala-mode-hook 'scala-turnoff-indent-tabs-mode)
;; YASNIPPIT
(require 'yasnippet-bundle)
(yas/initialize)
;; CEDET
(load-file "~/.emacs.d/cedet-1.0/common/cedet.el")
(load "~/.emacs.d/cedet-1.0/contrib/semantic-ectag-scala.el")
;;(global-ede-mode 1) ; Enable the Project management system
(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
(global-srecode-minor-mode 1) ; Enable template insertion menu
(semantic-load-enable-primary-exuberent-ctags-support)
;; ECB - yuck!
;(add-to-list 'load-path "~/.emacs.d/ecb")
;(require 'ecb)
;; (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.
;; '(dabbrev-case-fold-search nil)
;; '(ecb-options-version "2.40")
;; '(global-semantic-decoration-mode nil nil (semantic-decorate-mode))
;; '(global-semantic-highlight-edits-mode nil nil (semantic-util-modes))
;; '(global-semantic-highlight-func-mode nil nil (semantic-util-modes))
;; '(global-semantic-idle-completions-mode t nil (semantic-idle))
;; '(global-semantic-idle-scheduler-mode nil nil (semantic-idle))
;; '(global-semantic-idle-summary-mode nil nil (semantic-idle))
;; '(global-semantic-idle-tag-highlight-mode nil nil (semantic-idle))
;; '(global-semantic-mru-bookmark-mode t nil (semantic-util-modes))
;; '(global-semantic-show-parser-state-mode nil nil (semantic-util-modes))
;; '(global-semantic-show-unmatched-syntax-mode nil nil (semantic-util-modes))
;; '(global-semantic-stickyfunc-mode nil nil (semantic-util-modes))
;; '(global-senator-minor-mode t nil (senator))
;; '(inhibit-startup-screen t)
;; '(semantic-complete-inline-analyzer-displayor-class (quote semantic-displayor-tooltip))
;; '(semantic-complete-inline-analyzer-idle-displayor-class (quote semantic-displayor-tooltip))
;; '(semantic-idle-scheduler-verbose-flag t)
;; '(semantic-imenu-sort-bucket-function (quote semantic-sort-tags-by-name-increasing))
;; '(semanticdb-global-mode t nil (semanticdb))
;; '(show-paren-mode t)
;; '(transient-mark-mode t)
;; '(which-function-mode nil))
;; SBT
(load "~/.emacs.d/sbt.el")
;;; ================================================================ SCALA END
;;; TODO -- get this working
;;(load-file "~/.emacs.d/rudel/rudel-loaddefs.el")
(add-to-list 'auto-mode-alist '("\\.scss$" . sass-mode))
;;(menu-bar-mode)
(defun underscore-string (s &optional sep start)
"Convert CamelCase string S to lower case with word separator SEP.
Default for SEP is an underscore \"_\".
If third argument START is non-nil, convert words after that
index in STRING."
(let ((case-fold-search nil))
(while (string-match "[A-Z]" s (or start 1))
(setq s (replace-match (concat (or sep "_")
(downcase (match-string 0 s)))
t nil s)))
(downcase s)))
(defun mapcar-head (fn-head fn-rest list)
"Like MAPCAR, but applies a different function to the first element."
(if list
(cons (funcall fn-head (car list)) (mapcar fn-rest (cdr list)))))
(defun camelize (s)
"Convert under_score string S to CamelCase string."
(mapconcat 'identity (mapcar
'(lambda (word) (capitalize (downcase word)))
(split-string s "_")) ""))
(add-to-list 'load-path "~/.emacs.d/coffee-mode")
(require 'coffee-mode)
(custom-set-variables
'(inhibit-startup-screen t))
(defun create-tags (dir-name)
"Create tags file."
(interactive "DDirectory: ")
(eshell-command
(format "find %s -type f -name \"*.[ch]\" | etags -L -" dir-name)))