forked from dls/.emacs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dotemacs
340 lines (285 loc) · 10 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
(add-to-list 'load-path "~/.emacs.d")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(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 [?\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")
(add-to-list 'load-path "~/.emacs.d/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)
(setq auto-mode-alist (cons '( "\\.d\\'" . d-mode ) auto-mode-alist ))
(autoload 'dlint-minor-mode "dlint" nil t)
(add-hook 'd-mode-hook (lambda () (dlint-minor-mode 1)))
(add-to-list 'load-path "~/.emacs.d/ess/lisp")
(require 'ess-site)
(defun word-count nil "Count words in buffer" (interactive)
(shell-command-on-region (point-min) (point-max) "wc -w"))
(setq load-path (cons "~/.emacs.d/emacs-rails" load-path))
(require 'rails)
(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"))
;;; --- 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)
)))
(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)
(if (boundp 'scroll-bar-mode)
(scroll-bar-mode))
;;(server-start)
(require 'org-protocol)
(set-face-attribute 'default nil :height 80)
(require 'js2-mode)
;; I hate tabs
(setq-default indent-tabs-mode nil)
(add-to-list 'load-path "~/.emacs.d/tuareg-mode")
(add-to-list 'load-path "~/.emacs.d/actionscript-mode.connors")
(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)
(if (and (boundp 'window-system) window-system)
(when (string-match "XEmacs" emacs-version)
(if (not (and (boundp 'mule-x-win-initted) mule-x-win-initted))
(require 'sym-lock))
(require 'font-lock)))