-
Notifications
You must be signed in to change notification settings - Fork 0
/
emacs.txt
211 lines (169 loc) · 6.25 KB
/
emacs.txt
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
;; N'affiche pas la toolbar
(tool-bar-mode nil)
;; N'affiche pas le menu
(menu-bar-mode nil)
;; Affiche l'heure
(setq display-time-24h-format)
;;(display-time)
;; Couleurs pour la prog
(global-font-lock-mode)
(setq font-lock-maximum-decoration t)
;; Info perso
(setq mail-host-address "epita.fr")
(setq user-mail-address "[email protected]")
(setq user-full-name "Deiana Alessio")
;; Scripts
(setq load-path (cons "~/.emacs.d/" load-path))
(load "std.el")
(load "std_comment.el")
(load "tiger.el")
;(load "c-font-lock-keywords.el")
;;(load "colors.el")
(load "hideshow.el")
;; Coloration syntaxique pour le caml
(setq load-path (cons "/u/a1/deiana_a/tuareg-mode-1.41.5" load-path))
(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)))
;; Coloration syntaxique pour le tiger
(require 'tiger)
(add-to-list 'auto-mode-alist '("\\.tig$" . tiger-mode))
;; Coloration syntaxique
;(require 'c-font-lock-keywords)
;; Pour avoir le numero de ligne du curseur
(line-number-mode t)
;; Pour avoir le numero de colonne du curseur
(column-number-mode t)
;; Affiche les espaces en fin de ligne
;;(setq-default show-trailing-whitespace t)
;; Change la police d'affichage
(setq default-frame-alist '((font . "-Adobe-Courier-Bold-R-Normal--17-120-100-100-M-100-ISO8859-1")
(height . 35)
(width . 80)))
(defun next-buffer ()
"Switch to the next buffer in cyclic order."
(interactive)
(let ((buffer (current-buffer)))
(switch-to-buffer (other-buffer buffer))
(bury-buffer buffer)))
(defun prev-buffer ()
"Switch to the previous buffer in cyclic order."
(interactive)
(let ((list (nreverse (buffer-list)))
found)
(while (and (not found) list)
(let ((buffer (car list)))
(if (and (not (get-buffer-window buffer))
(not (string-match "\\`"(buffer-name buffer))))
(setq found buffer)))
(setq list (cdr list)))
(switch-to-buffer found)))
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(backup-directory-alist (quote ((".*" . "~/backup"))))
'(backward-delete-char-untabify-method nil)
'(blink-cursor nil)
'(browse-url-browser-function (quote browse-url-generic) t)
'(browse-url-generic-program "mozilla" t)
'(delete-selection-mode t nil (delsel))
'(iswitchb-mode t nil (iswitchb))
'(iswitchb-regexp t)
; '(normal-erase-is-backspace t)
'(pc-select-override-scroll-error t)
'(require-final-newline (quote ask))
'(scroll-bar-mode nil)
'(track-eol nil)
'(transient-mark-mode t)
'(uniquify-buffer-name-style (quote post-forward-angle-brackets) nil (uniquify)))
;(setq scroll-step 1)
;(setq next-screen-context-lines 1)
;; Key Bindings
(global-set-key [f5] `recompile)
(global-set-key [f6] `compile)
(global-set-key [f7] `cvs-update)
(global-set-key [f8] 'gnus)
;; passe en mode accents 'e devient <E9>
(global-set-key [f9] 'iso-accents-mode)
;; Raccourcis pour le code folding
(global-set-key [f10] 'hs-hide-all)
(global-set-key [f11] 'hs-show-all)
(global-set-key [f12] 'hs-toggle-hiding)
;; deplacement rapide
(global-set-key [kp-divide] "/")
(global-set-key "\M-g" 'goto-line)
(global-set-key [C-right] 'forward-word)
(global-set-key [C-left] 'backward-word)
(global-set-key [end] 'end-of-line)
(global-set-key [C-up] 'backward-paragraph)
(global-set-key [C-down] 'forward-paragraph)
(define-key global-map [?\C-x right] 'next-buffer)
(define-key global-map [?\C-x left] 'prev-buffer)
;(global-set-key [down] 'forward-line)
(global-set-key [delete] 'delete-char)
;(global-set-key "^D" 'backward-delete-char)
;; HOME et END sous Putty
(global-set-key "ESC[1~" 'beginning-of-line)
(global-set-key "ESC[4~" 'end-of-line)
;; Affiche la parenthese correspondante
(show-paren-mode t)
(set-cursor-color "blue")
;; retour a la ligne en cas de ligne depassant la taille de la fenetre.
(setq-default truncate-lines nil)
;; affiche un carre noir au lieu d'un beep
(setq visible-bell t)
;; Having accents in `no-window' mode (launch emacs -nw)
;; permet de voir les accents en mode console et notamment sous putty
;;(if (memq window-system '(nil))
;; (progn
;; (standard-display-european nil))
;; )
(setq gnus-article-decode-charset 1)
(setq gnus-select-method `(nntp "news.epita.fr"))
;; Appearence
;;(set-background-color "black")
;;(set-foreground-color "white")
;; Efface les espaces en fin de ligne a la sauvegarde
(defun my-hook-save ()
(cond ((not (eq major-mode 'message-mode)) (delete-trailing-whitespace))))
(add-hook 'write-file-hooks 'my-hook-save)
;; hideshow
(load-library "hideshow")
(add-hook 'c-mode-hook ; code folding for c files
'(lambda () (hs-minor-mode 1)))
(add-hook 'c++-mode-hook ; code folding for c++ files
'(lambda () (hs-minor-mode 1)))
;; Correction d'orthographe
;;(require 'flyspell)
;;(add-hook 'text-mode-hook 'flyspell-mode)
;;
;;(custom-set-variables
;; '(flyspell-dictionaries-that-consider-dash-as-word-delimiter (quote
;; ("francais")))
;; Indentation qu'avec des tabs
; setq-default indent-tabs-mode nil)
; (setq-default tab-width 4)
;; Backup directories
(setq backup-directory "~/backup")
;;(require 'paren)
;; Scroll par ligne et non par acoup
(setq scroll-conservatively 100)
;; Unify accentued char on decoding/encoding
;(require 'ucs-tables)
;(unify-8859-on-decoding-mode t)
;(unify-8859-on-encoding-mode t)
;; Go into iso-accent-mode when editing mails and news.
(add-hook 'message-mode-hook 'iso-accents-mode)
;; Lang env for copy paste to/from other programs
;(iso-accents-mode t)
;;(set-input-method "latin-9-prefix")
(set-language-environment "latin-9")
(set-keyboard-coding-system 'iso-latin-9)
(set-terminal-coding-system 'iso-latin-9)
(set-selection-coding-system 'iso-latin-9)
;; (transient-mark-mode t)