-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot.emacs.el
More file actions
211 lines (185 loc) · 8.36 KB
/
dot.emacs.el
File metadata and controls
211 lines (185 loc) · 8.36 KB
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
;;
;; My own setting
;;
;; =============================================================================
;; 새로운 프레임 생성시 크기 설정
;; =============================================================================
(setq initial-frame-alist '((width . 120) (height . 75))) ;; 첫번째 프래임의 크기를 설정
(setq default-frame-alist '((width . 80) (height . 40))) ;; 그 다음 프래임의 크기를 설정
;(setq load-path (nconc '("~/.emacs") load-path)) ;; 개인 lisp 패키지가 위치 할 load-path 설정
;(setq load-path (nconc '("~/.emacs.d") load-path)) ;; 개인 lisp 패키지가 위치 할 load-path 설정
(setq frame-title-format
(list (format "%s %%S: %%j " (system-name))
'(buffer-file-name "%f" (dired-directory dired-directory "%b"))))
(defun show-file-name ()
"Show the full path file name in the minibuffer."
(interactive)
(message (buffer-file-name)))
(global-set-key [C-f1] 'show-file-name) ; Or any other key you want
; for cscope
(require 'xcscope)
(setq cscope-do-not-update-database t)
;; =============================================================================
;; person info
;; =============================================================================
(setq user-full-name "Doo-Hyun Jang")
(setq user-mail-address "[email protected]")
;; =============================================================================
;; 기본 색 지정
;; =============================================================================
(set-foreground-color "wheat")
(set-background-color "DarkSlateGray")
;; =============================================================================
;; 영역 색 지정
;; =============================================================================
(set-face-foreground 'region "white")
(set-face-background 'region "cadetblue")
;; =============================================================================
;; 한글 세벌식 최종
;; =============================================================================
(set-input-method "korean-hangul3f") ;; if you want 3 beolsik final...
;;모드라인에 현재 커서의 줄과 칼럼위치 시간 표시('mode line hacking'때문에 필요 없음)
(setq column-number-mode t) ;;컬럼수를 모드라인에 표시할 경우 에디팅 속도가 느려진다
;; function to reload .emacs 2008.01.24
;; 출처 : http://hermian.tistory.com/195
(defun reload-dotemacs ()
"Reload .emacs"
(interactive)
(load-file "~/.emacs.el"))
; for emacsclient
(server-start)
;; Switch fromm *.<impl> to *.<head> and vice versa
(defun switch-cc-to-h ()
(interactive)
(when (string-match "^\\(.*\\)\\.\\([^.]*\\)$" buffer-file-name)
(let ((name (match-string 1 buffer-file-name))
(suffix (match-string 2 buffer-file-name)))
(cond ((string-match suffix "c\\|cc\\|C\\|cpp")
(cond ((file-exists-p (concat name ".h"))
(find-file (concat name ".h"))
)
((file-exists-p (concat name ".hh"))
(find-file (concat name ".hh"))
)
))
((string-match suffix "h\\|hh")
(cond ((file-exists-p (concat name ".cc"))
(find-file (concat name ".cc"))
)
((file-exists-p (concat name ".C"))
(find-file (concat name ".C"))
)
((file-exists-p (concat name ".cpp"))
(find-file (concat name ".cpp"))
)
((file-exists-p (concat name ".c"))
(find-file (concat name ".c"))
)))))))
;; ================================================================================
;; auto mode alist
;; ================================================================================
;;(setq-default auto-fill-function 'do-auto-fill) ;; auto-fill모드 설정
(autoload 'x-resource-generic-mode "generic-x" nil t) ;; generic-x 모드 설정
(setq auto-mode-alist
(nconc '(("\\.ml[iylp]?\\'" . caml-mode)
("\\.sml\\'" . sml-mode)
("\\.grm\\'" . sml-mode)
("\\.ML\\'" . sml-mode)
("\\.htm\\'" . html-helper-mode)
("\\.html\\'" . html-helper-mode)
("\\.shtml\\'" . html-helper-mode)
("\\.thtml\\'" . html-helper-mode)
("\\.css\\'" . css-mode)
("\\.php\\'" . php-mode)
("\\.php3\\'" . php-mode)
("\\.gnus\\'" . emacs-lisp-mode)
("\\.abbrev_defs\\'" . emacs-lisp-mode)
("\\el\\'" . emacs-lisp-mode)
("\\.s?html\\'" . sgml-mode)
("\\.sgml\\'" . sgml-mode)
("\\.tex\\'" . latex-mode)
("\\.ks$\\'" . latex-mode)
("\\.cl\\'" . lisp-mode)
("\\.cgi\\'" . cperl-mode)
("\\.pl\\'" . cperl-mode)
("\\.pm\\'" . cperl-mode)
("\\.py\\'" . phthon-mode)
("\\.c\\'" . c-mode)
("\\.C\\'" . c-mode)
("\\.cc\\'" . c++-mode)
("\\.cpp\\'" . c++-mode)
("\\.h\\'" . c++-mode)
("\\.hh\\'" . c++-mode)
("\\.idl\\'" . c++-mode)
("\\.txi\\'" . Texinfo-mode)
("\\.java\\'" . java-mode)
("\\.prolog\\'" . prolog-mode)
("\\.pro\\'" . prolog-mode)
("\\.txt\\'" . text-mode))
auto-mode-alist))
;; ================================================================================
;; C mode
;; ================================================================================
(add-hook 'c-mode-common-hook
'(lambda()
(c-set-style "k&r") ;;C 코딩 스타일 정의
))
(add-hook 'c++-mode-common-hook
'(lambda()
(c-set-style "k&r") ;;C 코딩 스타일 정의
))
;; revert buffer. 파일 내용이나 디렉토리 내용이 바뀌어서 Disk의 내용을 다시 불러올때
;; g : dired 모드에서 사용
;; M-x revert-buffer RET yes RET
;; C-x C-v RET
(defun revert-all-buffers()
"Refreshs all open buffers from their respective files"
(interactive)
(let* ((list (buffer-list))
(buffer (car list)))
(while buffer
(if (string-match "\\*" (buffer-name buffer))
(progn
(setq list (cdr list))
(setq buffer (car list)))
(progn
(set-buffer buffer)
(revert-buffer t t t)
(setq list (cdr list))
(setq buffer (car list))))))
(message "Refreshing open files"))
;; ================================================================================
;; show paren mode. 괄호등을 사용할때 마지막에 사용된 괄호에 대응하는 괄호를 찾음
;; ================================================================================
(show-paren-mode 1)
(setq enable-recursive-minibuffers t)
;; ================================================================================
;; ;;indent with just spaces 들여쓰기 설정
;; ================================================================================
;;(setq-default indent-tabs-mode nil) ;; nil 이 아니면 들여쓰기 명령이 탭문자를 입력한다.(버퍼지역변수)
(setq-default indent-tabs-mode t) ;; nil 이 아니면 들여쓰기 명령이 탭문자를 입력한다.(버퍼지역변수)
(setq tab-stop-list '(4 8 12 16 20 24 28 32 26 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))
(setq default-tab-width 4) ;; 탭간 간격(버퍼지역변수)
;; automatically indenting yanked text if in programming-modes
;; 붙여넣기 하면서 자동 들여쓰기 함수
(defadvice yank (after indent-region activate)
(if (member major-mode '(emacs-lisp-mode
c-mode c++-mode
tcl-mode sql-mode
perl-mode cperl-mode
java-mode jde-mode
LaTeX-mode TeX-mode))
(let ((transient-mark-mode nil))
(indent-region (region-beginning) (region-end) 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.
'(column-number-mode 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 (:family "NanumGothicCoding" :foundry "nil" :slant normal :weight normal :height 141 :width normal)))))