forked from suztomo/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 53
/
.emacs.el
260 lines (192 loc) · 6.58 KB
/
.emacs.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
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
;; (setq load-path (cons "~/dotfiles/.elisp/tuareg" load-path))
;; (setq load-path (cons "~/dotfiles/.elisp/" load-path))
(setq debug-on-error nil)
(add-to-list 'load-path "~/dotfiles/.elisp")
(add-to-list 'load-path "~/dotfiles/.elisp/conf")
(add-to-list 'load-path "~/dotfiles/.elisp/tuareg")
;; C-h to backspace
;;(global-set-key "\C-h" 'delete-backward-char)
;;(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)
(line-number-mode t)
;(column-number-mode nil)
;; Riece
(setq riece-server-alist
'(("is2007" :host "irc.freenode.net" :coding utf-8 :nickname "suzemacs")))
;; Tabはspace x 4
(setq-default tab-width 4 indent-tabs-mode nil)
;;smart-compile
(require 'smart-compile)
;; utf-8
(progn
(set-language-environment 'Japanese)
(set-terminal-coding-system 'utf-8)
(setq file-name-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
;; For yatex mode
;; (setq coding-system-for-read 'mule-utf-8-unix)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8-unix)
)
;; (when (eq window-system 'mac)
;; (add-hook 'window-setup-hook
;; (lambda ()
;; ;; (setq mac-autohide-menubar-on-maximize t)
;; (set-frame-parameter nil 'fullscreen 'fullboth)
;; )))
;; CarbonEmacsやgtkのemacsで最大化
(defun toggle-max-window ()
(interactive)
(if (frame-parameter nil 'fullscreen)
(set-frame-parameter nil 'fullscreen nil)
(set-frame-parameter nil 'fullscreen 'fullboth)))
;; Carbon Emacsの設定で入れられた
(custom-set-variables
'(display-time-mode t)
'(tool-bar-mode nil)
'(transient-mark-mode t))
(custom-set-faces
)
;;Color
(if window-system (progn
(set-background-color "Black")
(set-foreground-color "LightGray")
(set-cursor-color "Gray")
(set-frame-parameter nil 'alpha 80)
))
;; Highlight Parens
(load "mic-paren.el")
(require 'mic-paren)
(paren-activate)
;; Visible marked area
(transient-mark-mode t)
;; Yatex Mode
(setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
(add-hook 'yatex-mode-hook' (lambda () (setq auto-fill-function nil)))
;; Smooth down key
(progn
(setq scroll-step 1)
(setq scroll-conservatively 4))
;; Answer y or n
(fset 'yes-or-no-p 'y-or-n-p)
;; no backup file
;(progn
; (setq auto-save-list-file-name nil)
; (setq auto-save-list-file-prefix nil)
; (setq make-backup-files nil))
;; Show time in status line
(progn
(setq display-time-24hr-format t)
(setq display-time-format "%Y-%m-%d(%a) %H:%M")
(setq display-time-day-and-date t)
(setq display-time-interval 30)
(display-time))
;; Ack
;; http://d.hatena.ne.jp/antipop/20080311/1205252552
(defun ack ()
(interactive)
(let ((grep-find-command "ack --nocolor --nogroup --ignore-dir=HTML"))
(call-interactively 'grep-find)))
;; C-o to move window
;; But it conflicts "Open directory" in Dired-mode....
(global-set-key "\C-o" 'next-multiframe-window)
;; Orikaeshi
(setq truncate-partial-width-windows nil)
;; uniquify
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)
; install-elisp
; http://d.hatena.ne.jp/tomoya/20090121/1232536106
(require 'install-elisp)
(setq install-elisp-repository-directory (expand-file-name "~/dotfiles/.elisp/"))
; key-chord
; http://d.hatena.ne.jp/rubikitch/20081104/1225745862
(require 'key-chord)
(setq key-chord-two-keys-delay 0.04)
(key-chord-mode 1)
(load "init-physical-move")
(load "init-shell")
(load "init-flymake")
;(load "init-js2")
(load "init-jaspace")
(when (eq window-system 'mac)
(load "init-skk"))
;(load "init-perl")
;(load "init-cpp")
;(load "init-autosave-enhanced")
(load "init-autosave")
(load "init-auto-complete")
(load "init-anything")
(load "init-revive")
;(load "init-html")
(load "init-gauche")
(load "init-python")
(load "init-gdb")
(load "init-gtags")
;(load "init-search")
;(load "less")
(load "init-spell")
(load "init-view")
(load "init-yasnippet")
;(add-to-list 'load-path "/directory/containing/nav/")
;; Project home http://code.google.com/p/emacs-nav/
;; Instructions are seen in the source file nav.el
(require 'nav)
;; Physical line
; http://hal.e-fpage.com/t/20080901.html#p01
(require 'physical-line)
(define-key global-map "\C-a" 'physical-line-beginning-of-line)
(define-key global-map "\C-e" 'physical-line-end-of-line)
;; 変態キーバインド
;; http://d.hatena.ne.jp/k12u/20081118/p1
;(global-set-key [S-right] 'split-window-horizontally)
;(global-set-key [S-left] 'split-window-horizontally)
;(define-key global-map [S-up] 'split-window-vertically)
;(define-key global-map [S-down] 'delete-other-windows)
;(global-set-key [right] 'windmove-right)
;(global-set-key [left] 'windmove-left)
;(define-key global-map [up] 'windmove-up)
;(define-key global-map [down] 'windmove-down)
;(global-set-key [C-backspace] 'switch-to-buffer)
;(global-set-key [C-delete] '(lambda() (interactive)(kill-buffer (buffer-name))))
;(global-set-key [C-right] 'elscreen-next)
;(global-set-key [C-left] 'elscreen-previous)
;(global-set-key [C-return] 'find-file)
;--------------------------------------------------------------------------------
;; scroll n line from Mr.Sekiguchi *C-q と C-z に当てている。
; by katchan
;--------------------------------------------------------------------------------
(defun scroll-n-lines-ahead (&optional n)
"Scroll ahead N lines (default N = 2)"
(interactive "p")
(scroll-up (prefix-numeric-value n)))
(defun scroll-n-lines-behind (&optional n)
"Scroll behind N lines (default N = 2)"
(interactive "p")
(scroll-down (prefix-numeric-value n)))
(global-set-key "\C-z" 'scroll-n-lines-ahead)
(global-set-key "\C-q" 'scroll-n-lines-behind)
;; デフォルトで分割
(split-window-horizontally)
(if window-system (set-frame-parameter nil 'fullscreen 'fullboth))
; adjust Jis_table
; define whizzy-command-name
(autoload 'whizzytex-mode
"whizzytex"
"WhizzyTeX, a minor-mode WYSIWIG environment for LaTeX" t)
;; Egg the emacs controller of git
;; http://github.com/bogolisk/egg/wikis
;; C-v + c:commit, d:status, l:log, l p:push
(add-to-list 'exec-path "/usr/local/git/bin")
(require 'egg)
;; Bookmark
(defadvice bookmark-set (around bookmark-set-ad activate)
(bookmark-load bookmark-default-file t t) ;; 登録前に最新のブックマークを読み直す
ad-do-it
(bookmark-save))
(defadvice bookmark-jump (before bookmark-set-ad activate)
(bookmark-load bookmark-default-file t t))