]> git.ipfire.org Git - thirdparty/freeswitch.git/blob - support-d/.emacs
[Core] Add new switch_channel_get_variable_strdup() and switch_channel_get_variable_b...
[thirdparty/freeswitch.git] / support-d / .emacs
1
2 ;(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t)
3
4 ;;; You can either fine-tune the bells and whistles of this mode or
5 ;;; bulk enable them by putting
6 ;(setq cperl-hairy t)
7 (global-unset-key "\C-h")
8 (global-set-key "\C-h" 'delete-backward-char)
9 ;(load "/usr/share/emacs/site-lisp/rng-auto.el")
10
11 (require 'cc-mode)
12 (defun my-build-tab-stop-list (width)
13 (let ((num-tab-stops (/ 80 width))
14 (counter 1)
15 (ls nil))
16 (while (<= counter num-tab-stops)
17 (setq ls (cons (* width counter) ls))
18 (setq counter (1+ counter)))
19 (set (make-local-variable 'tab-stop-list) (nreverse ls))))
20 (defun my-c-mode-common-hook ()
21 (setq tab-width 4) ;; change this to taste, this is what K&R uses :)
22 (my-build-tab-stop-list tab-width)
23 (setq c-basic-offset tab-width)
24 (setq indent-tabs-mode t)) ;; force only spaces for indentation
25 (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
26
27
28
29 (add-hook 'c-mode-common-hook
30 (lambda()
31 (local-set-key (kbd "C-c <right>") 'hs-show-block)
32 (local-set-key (kbd "C-c <left>") 'hs-hide-block)
33 (local-set-key (kbd "C-c <up>") 'hs-hide-all)
34 (local-set-key (kbd "C-c <down>") 'hs-show-all)
35 (hs-minor-mode t)))
36
37
38 ;; replace C-s with C-\ in a much more general way so that C-\ can be typed
39 ;; for every instance of C-s. It is at such a low level that emacs even thinks
40 ;; that you typed a C-s. replace C-s with C-\ , globally
41 ;; this disables any command which uses C-\ I believe there are two
42 ;; Note That position \034(octal) which is C-\ is switched with \023(octal)
43 ;; which is C-s
44
45 (setq keyboard-translate-table "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\023\035\036\037 !\042#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\134]^_`abcdefghijklmnopqrstuvwxyz{|}~\177")
46
47
48 ;; change ctrl-q so it can be used as flow control
49 ;; remap C-q tp ESC `
50
51 ;; (global-unset-key "\C-q")
52 ;; (global-set-key "\e`" 'quoted-insert)
53
54
55 ;; don't make backup files
56 ;; (setq make-backup-files nil)
57 (setq require-final-newline t)
58
59
60 ;; change input mod to CBREAK mode for C-s C-q
61 ;; emacs will never see C-s, C-q
62 ;; (set-input-mode nil t)
63
64 ;; change help command from C-h to ESC ?
65 ;; so we can use C-h for backspace
66 (global-unset-key "\C-h")
67 (global-set-key "\C-h" 'delete-backward-char)
68
69 (global-set-key "\e?" 'help-command)
70 (global-set-key "\C-x\C-x" 'mail-send)
71 ;; set backspace to delete a char same as DEL
72
73 ;; (global-unset-key "\d")
74 ;; (global-set-key "\d" 'delete-char)
75 (global-set-key "\C-cg" 'goto-line)
76 ;; set up the ispell spelling checker interface
77 (global-unset-key "\C-o")
78 (global-set-key "\C-o" 'undo)
79 (global-set-key "\M-\]" 'copy-region-as-kill)
80 (global-set-key "\C-\\" 'mark-word)
81 (global-unset-key "\C-f" )
82 (global-set-key "\C-f" 'forward-word)
83 (global-unset-key "\C-b" )
84 (global-set-key "\C-b" 'backward-word)
85 (global-unset-key "\M-f" )
86
87
88 (global-set-key "\M-f" 'find-file)
89 (global-set-key "\M-o" 'find-file-other-window)
90 (global-set-key "\M-\\" 'mark-word)
91 (global-set-key "\M-{" 'mark-whole-buffer)
92 ;(global-unset-key "\M-}")
93
94
95
96 (global-set-key "\M-}" 'indent-region)
97 (global-set-key "\C-x\C-m" 'save-buffer)
98 (global-set-key "\C-c\C-m" 'delete-other-windows)
99 (global-set-key "\C-c\'" 'split-window-vertically)
100 (global-set-key "\C-c\;" 'split-window-horizontally)
101 (global-set-key "\C-x\z" 'yank)
102
103
104
105 (autoload 'ispell-word "ispell"
106 "Check the spelling of word in buffer." t)
107 (autoload 'ispell-complete-word "ispell" "Complete word at or before point" t)
108 (autoload 'ispell-region "ispell"
109 "Check spelling of every word in the region" t)
110 (autoload 'ispell-buffer "ispell"
111 "Check spelling of every word in the buffer" t)
112
113 (global-set-key "\e$" 'ispell-word)
114 (global-unset-key "\C-t")
115 (global-set-key "\C-t" 'forward-word)
116 ;; (global-unset-key "\C-&")
117 ;; (global-set-key "\C-&" 'backward-word)
118 (global-set-key "\C-cs" 'ispell-region)
119
120 (global-set-key "\C-c," 'backward-paragraph)
121 (global-set-key "\C-c." 'forward-paragraph)
122 (global-set-key "\C-c\C-c" 'compile)
123 (global-set-key "\C-c\/" 'compile)
124 (global-set-key "\C-c\]" 'replace-string)
125 (global-set-key "\C-ce" 'exchange-dot-and-mark)
126 (global-set-key "\C-cs" 'shrink-window)
127
128 ;; THE FOLLOWING ARE CUSTOMIZATIONS YOU CAN ADD IF YOU WANT THEM
129 ;; YOU WILL HAVE TO EDIT THIS FILE TO DO SO
130
131 ;; AUTO FILL
132 ;; If you want emacs to automatically wrap when you reach the
133 ;; end of a line (i.e. you don't have to type in the RETURN at the
134 ;; end of each line, you just keep typing) remove the semicolons
135 ;; from the two line after this paragraph (the ones with setq).
136 ;; Set the default major mode to text mode and turn on auto fill
137
138
139 ;;(setq default-major-mode 'text-mode)
140 (setq text-mode-hook 'turn-on-auto-fill)
141 ;; (setq load-path ("/usr/local/lib/emacs/lisp/" "/usr/local/test/lib/emacs/site-lisp" "/home/anthm/.lisp"))
142 (setq term-file-prefix (concat (car load-path) "/term/"))
143 (setq term-setup-hook '(lambda nil
144 (if (fboundp 'enable-arrow-keys) (enable-arrow-keys))))
145
146 ; (autoload 'html-mode "/home/anthm/.lisp/html-mode" "HTML major mode." t)
147 ;(or (assoc "\\.html$" auto-mode-alist)
148 ; (setq auto-mode-alist (cons '("\\.html$" . html-mode)
149 ; auto-mode-alist)))
150
151
152
153 (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))
154 (setq auto-mode-alist (cons '("\\.cgi$" . cperl-mode) auto-mode-alist))
155 (setq auto-mode-alist (cons '("\\.p[ml]$" . cperl-mode) auto-mode-alist))
156
157 (setq auto-mode-alist (cons '("\\.xml$" . nxml-mode) auto-mode-alist))
158
159 (setq html-helper-do-write-file-hooks t)
160 (setq html-helper-build-new-buffer t)
161
162
163 (add-hook 'cperl-mode-hook 'n-cperl-mode-hook t)
164 (defun n-cperl-mode-hook ()
165 ; (setq cperl-indent-level 4)
166 ; (setq cperl-continued-statement-offset 0)
167 ; (setq cperl-extra-newline-before-brace t)
168 (set-face-background 'cperl-array-face "black")
169 (set-face-background 'cperl-hash-face "black")
170 )
171
172
173
174
175
176 (cond ((fboundp 'global-font-lock-mode)
177 ;; Customize face attributes
178 (setq font-lock-face-attributes
179 ;; Symbol-for-Face Foreground Background Bold Italic Underline
180 '((font-lock-comment-face "green")
181 (font-lock-preprocessor-face "gray")
182 (font-lock-string-face "Sienna")
183 (font-lock-keyword-face "purple")
184 (font-lock-function-name-face "limegreen")
185 (font-lock-variable-name-face "Yellow")
186 (font-lock-type-face "Yellow")
187 (font-lock-reference-face "Purple")
188
189 (font-lock-builtin-face "limegreen")
190 (font-lock-constant-face "yellow")
191 (font-lock-doc-face "limegreen")
192 (font-lock-highlighting-face "limegreen")
193 (font-lock-warning-face "limegreen")
194
195 ))
196 ;; Load the font-lock package.
197 (require 'font-lock)
198 ;; Maximum colors
199 (setq font-lock-maximum-decoration t)
200 ;; Turn on font-lock in all modes that support it
201 (global-font-lock-mode t)))
202
203
204
205
206
207
208
209 ;; Fix for arrow key disease
210
211
212 (define-key function-key-map "\eOA" [up])
213 (define-key function-key-map "\e[A" [up])
214 (define-key function-key-map "\eOB" [down])
215 (define-key function-key-map "\e[B" [down])
216 (define-key function-key-map "\eOC" [right])
217 (define-key function-key-map "\e[C" [right])
218 (define-key function-key-map "\eOD" [left])
219 (define-key function-key-map "\e[D" [left])
220
221
222
223
224
225
226
227 (set-background-color "black")
228 (set-foreground-color "white")
229 (set-cursor-color "white")
230