3
;; 2001-March-10 Jason Rohrer
5
;; Fixed so that c++ mode is used for .h files.
6
;; Fixed [C-backspace] mapping.
8
;; 2001-May-21 Jason Rohrer
9
;; Changed so that Java inclass items are not doubly indented.
11
;; 2002-January-21 Jason Rohrer
12
;; Gave in and set to use spaces instead of tabs.
13
;; This is primarily motivated by the fact that tabs look terrible
16
;; 2005-January-16 Jason Rohrer
21
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
22
;; Your init file should contain only one such instance.
24
'(current-language-environment "ASCII")
25
'(global-font-lock-mode t nil (font-lock))
26
'(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60)))
27
'(transient-mark-mode t))
29
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
30
;; Your init file should contain only one such instance.
34
;(setq-default scroll-step 1) ; turn off jumpy scroll
35
(setq-default visible-bell t) ; no beeps, flash on errors
37
(display-time) ; display the time on modeline
38
(column-number-mode t) ; display the column number on modeline
39
(setq-default kill-whole-line t) ; ctrl-k kills whole line if at col 0
40
(setq-default fill-column 80) ; wrap at col 80
41
(setq-default tab-width 4) ; show tabs as 4 cols
43
(setq font-lock-maximum-decoration t) ; use colours in font lock mode
44
(setq font-lock-maximum-size nil) ; turn off limit on font lock mode
46
; turn on font-lock everywhere (if possible)
47
(global-font-lock-mode 1 t)
49
; make sure C-backspace kills a word
50
( global-set-key `[C-backspace] `backward-kill-word )
52
; background color, light yellow
53
( add-to-list 'default-frame-alist '( background-color . "#FFFFDC" ) )
56
( add-hook 'c-mode-common-hook 'turn-on-auto-fill )
58
; fix comment syntax highlighting problems
59
( setq font-lock-support-mode 'lazy-lock-mode )
60
( setq lazy-lock-defer-time 0 )
62
; delete highlighted text as we type
63
( delete-selection-mode t )
65
; make sure c++ mode is used for .h files
66
( setq auto-mode-alist (
75
; off for now, since it screws up indenting
76
; load the line numbers package
79
;( add-hook 'c-mode-common-hook 'turn-on-setnu-mode )
82
( copy-face 'italic 'font-lock-comment-face )
83
( set-face-foreground 'font-lock-comment-face "#00AA00" )
84
( setq font-lock-comment-face 'font-lock-comment-face )
86
( copy-face 'default 'font-lock-string-face )
87
( set-face-foreground 'font-lock-string-face "#FF00FF" )
88
( setq font-lock-string-face 'font-lock-string-face )
90
( copy-face 'bold 'font-lock-type-face )
91
( set-face-foreground 'font-lock-type-face "#0000FF" )
92
( setq font-lock-type-face 'font-lock-type-face )
94
( copy-face 'bold 'font-lock-keyword-face )
95
( set-face-foreground 'font-lock-keyword-face "#C88000" )
96
( setq font-lock-keyword-face 'font-lock-keyword-face )
99
( copy-face 'default 'font-lock-function-name-face )
100
( set-face-foreground 'font-lock-function-name-face "#C80000" )
101
( setq font-lock-function-name-face 'font-lock-function-name-face )
103
( copy-face 'default 'font-lock-variable-name-face )
104
( set-face-foreground 'font-lock-variable-name-face "#0000FF" )
105
( setq font-lock-variable-name-face 'font-lock-variable-name-face )
107
( copy-face 'bold 'font-lock-constant-face )
108
( set-face-foreground 'font-lock-constant-face "#C800FF" )
109
( setq font-lock-constant-face 'font-lock-constant-face )
111
( copy-face 'bold 'font-lock-warning-face )
112
( set-face-foreground 'font-lock-warning-face "#FF0000" )
113
( setq font-lock-warning-face 'font-lock-warning-face )
115
( copy-face 'default 'font-lock-reference-face )
116
( set-face-foreground 'font-lock-reference-face "#00FFFF" )
117
( setq font-lock-reference-face 'font-lock-reference-face )
123
'((c-tab-always-indent . t)
124
(c-comment-only-line-offset . 4)
125
(c-hanging-braces-alist . ((substatement-open after)
130
(brace-entry-open after)
132
(c-hanging-colons-alist . ((member-init-intro before)
136
(access-label after)))
137
(c-cleanup-list . (scope-operator
140
(c-offsets-alist . ((arglist-close . c-lineup-arglist)
141
(substatement-open . 0)
151
(brace-list-close . 4)
152
(knr-argdecl-intro . -)))
153
(c-echo-syntactic-information-p . t)
155
"My C Programming Style")
157
;; Customizations for all of c-mode, c++-mode, and objc-mode
158
(defun my-c-mode-common-hook ()
159
;; add my personal style and set it for the current buffer
160
(c-add-style "PERSONAL" my-c-style t)
162
;; offset customizations not in my-c-style
163
(c-set-offset 'member-init-intro '++)
164
;; other customizations
166
;; this will make sure spaces are used instead of tabs
167
indent-tabs-mode nil)
168
;; we like auto-newline and hungry-delete
169
(c-toggle-auto-hungry-state 1)
170
;; keybindings for C, C++, and Objective-C. We can put these in
171
;; c-mode-map because c++-mode-map and objc-mode-map inherit it
172
(define-key c-mode-map "\C-m" 'newline-and-indent)
175
;; the following only works in Emacs 19
176
;; Emacs 18ers can use (setq c-mode-common-hook 'my-c-mode-common-hook)
177
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
178
(add-hook 'java-mode-hook 'my-c-mode-common-hook)
183
( add-hook 'perl-mode-hook 'my-perl-mode-hook )
190
(setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
191
(autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
192
(autoload 'camldebug "camldebug" "Run the Caml debugger" t)
195
;(setq auto-mode-alist
196
; (cons '("\\.ml[iylp]?$" . caml-mode) auto-mode-alist))
197
;(autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
198
;(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)
199
;(if window-system (require 'caml-font))
200
(put 'downcase-region 'disabled nil)
204
;; actionscript (for flash development)
205
(autoload 'actionscript-mode "actionscript-mode" "Major mode for actionscript." t)
206
;; Activate actionscript-mode for any files ending in .as
207
(add-to-list 'auto-mode-alist '("\\.as$" . actionscript-mode))
208
;; Load our actionscript-mode extensions.
209
;;(eval-after-load "actionscript-mode" '(load "as-config"))
b'\\ No newline at end of file'