-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.emacs
More file actions
276 lines (233 loc) · 9.5 KB
/
.emacs
File metadata and controls
276 lines (233 loc) · 9.5 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
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; .emacs
;;
;; based on Jean's Hennebert's version
;; Jan Cernocky
;;
;; last modifications:
;; 24/9/98 - czechization
;; Tue May 11 09:28:30 CEST 1999 -- adding white for comments
;;
;; Tue Aug 17 19:03:54 CEST 1999
;; czech input from clipboard
;;
;; Mon Apr 10 16:12:46 CEST 2000
;; adding matlab mode, found matlab.el on:
;; ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons/matlab.el
;; following the instructions in that file.
;;
;; same day: changing re-coloring from hilit19 to font-lock.
;;
;; Wed Mar 21 15:27:14 PST 2001
;; turn off the verification on saving Matlab files (very boring, when a
;; text file contains just some Matlab commands, and m-mode thinks everything
;; is Matlab ...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(global-font-lock-mode t)
(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.
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server "kazi.fit.vutbr.cz")
'(smtpmail-smtp-service 25))
(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.
'(font-lock-comment-face ((((class color) (background dark)) (:foreground "White")))))
;;;;; Set utf system
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; ------ Highlighting - no more needed ! --------
;; (setq hilit-mode-enable-list '(not text-mode)
;; hilit-background-mode 'dark
;; hilit-inhibit-hooks nil
;; hilit-inhibit-rebinding nil)
;;
;; (require 'hilit19)
;; (hilit-translate comment 'white)
(line-number-mode t) ;; Shows current line number in status bar
(setq next-line-add-newlines nil) ;; Avoid odd behaviour of next-line
(setq scroll-step 1) ;; This is slower, but smoother
(setq delete-auto-save-files t)
(server-start) ;; allows this emacs to be server for client processes
;; Term bindings
(global-set-key "\eOA" 'previous-line)
(global-set-key "\eOC" 'forward-char)
(global-set-key "\eOB" 'next-line)
(global-set-key "\eOD" 'backward-char)
(global-set-key "\eOM" 'scroll-up)
(global-set-key "\eOk" 'scroll-down)
;; C mode definitions
(fmakunbound 'c-mode)
(makunbound 'c-mode-map)
(fmakunbound 'c++-mode)
(makunbound 'c++-mode-map)
(makunbound 'c-style-alist)
(autoload 'c++-mode "cc-mode" "C++ Editing Mode" t)
(autoload 'c-mode "cc-mode" "C Editing Mode" t)
(autoload 'matlab-mode "matlab" "Enter Matlab mode." t)
(setq matlab-verify-on-save-flag nil) ; turn off auto-verify on save
(defun my-matlab-mode-hook ()
(setq fill-column 256)) ; where auto-fill should wrap
(add-hook 'matlab-mode-hook 'my-matlab-mode-hook)
(defun my-matlab-shell-mode-hook ()
'())
(add-hook 'matlab-shell-mode-hook 'my-matlab-shell-mode-hook)
(setq auto-mode-alist
(append '(("\\.C$" . c++-mode)
("\\.cc$" . c++-mode)
("\\.cxx$". c++-mode)
("\\.c$" . c-mode) ; to edit C code
("\\.h$" . c-mode) ; to edit C code
("\\.tex" . latex-mode) ; jan added, was plain Tex, quite terrible
("\\.md" . markdown-mode)
("\\.m" . matlab-mode)
) auto-mode-alist))
(autoload 'matlab-shell "matlab" "Interactive Matlab mode." t)
;; jan wants GNU style, but indentation 3
(add-hook 'c-mode-hook
(function (lambda ()
(setq c-indent-level 3
c-argdecl-indent 5
c-brace-offset 0
c-continued-brace-offset 0
c-label-offset -3
c-continued-statement-offset 3
c-auto-newline f))))
;; ------------------------- Misc hook functions -------------------------
;; Force auto-fill-mode in text-mode and Tex Mode
(add-hook 'mail-mode-hook
(function (lambda ()
(auto-fill-mode 1))))
(add-hook 'tex-mode-hook
(function (lambda ()
(auto-fill-mode 1))))
;;
;; Window system
;;
(if window-system
(progn
;; Some new addition
(transient-mark-mode 1)
;; Colors, faces and fonts
(set-cursor-color "red")
(set-mouse-color "lightgreen")
(set-foreground-color "wheat") ;; was grey85
(set-background-color "black")
;; "bold" face definition
(set-face-foreground 'bold "cornsilk")
(set-face-background 'bold "darkslategrey")
(set-face-foreground 'bold-italic "yellow")
(set-face-background 'bold-italic "darkslategrey")
(set-face-foreground 'highlight "grey85")
(set-face-background 'highlight "darkslateblue")
(set-face-foreground 'underline "skyblue")
(set-face-background 'underline "darkslategrey")
(set-face-underline-p 'underline nil)
(set-face-foreground 'region "grey95")
(set-face-background 'region "grey40")
;; X Bindings
(global-set-key [next] 'scroll-up)
(global-set-key [prior] 'scroll-down)
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
(global-set-key [C-prior] 'beginning-of-buffer)
(global-set-key [C-next] 'end-of-buffer)
(global-set-key [kp-enter] 'scroll-up)
(global-set-key [kp-add] 'scroll-down)
(global-set-key [C-7] 'undo)
(global-set-key [C-delete] 'undo)
(global-set-key [C-backspace] 'undo)
(global-set-key [f5] 'delete-other-windows)
(global-set-key [f6] 'other-window)
;; Paren enlightning
(load-library "paren")
;; Draggable modeline ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(global-set-key [mode-line down-mouse-1] 'mldrag-drag-mode-line)
(global-set-key [vertical-line down-mouse-1] 'mldrag-drag-vertical-line)
(global-set-key [vertical-scroll-bar S-down-mouse-1]
'mldrag-drag-vertical-line)
(require 'mldrag)
;; Jan's Additional bindings -- let the first two ones commented out.
;; requires Jan's .Xmodmap file
;; (global-set-key "\?" 'help-command)
;; (global-set-key "\C-h" 'delete-backward-char)
(global-set-key [delete] 'delete-char)))
;; jan - does not have at esiee. require 'tex-site)
;;;;;;;;;;;;;;;;;;;;;; jan ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; french letters ;;;
(global-set-key [f9] "\\'e")
(global-set-key [f10] "\\`e")
(global-set-key [f11] "\\^e")
(global-set-key [f12] "\\`a")
; (global-set-key [S-kp-f1] "\\'{E}") ;this is for S-f9
; (global-set-key [S-kp-f2] "\\`{E}") ;this is for S-f10
; (global-set-key [S-kp-f3] "\\^{E}") ;this is for S-f11
; (global-set-key [S-kp-f4] "\\`{A}") ;this is for S-f12
;;; for the czech (copied /usr/doc/emacs-20.2/priklad_.emacs),
;;(register-input-method
;; "latin-2-prefix" "Latin-2" 'quail-use-package
;; "2>" "Latin-2 characters input method with prefix modifiers"
;; "quail/latin-pre")
;; RH 6.1
;;(load "/usr/share/emacs/20.7/leim/quail/czech.el")
;; RH 7
;;(load "/usr/share/emacs/20.7/leim/quail/czech.el")
;;(load "/u/honza/BORDEL/czech")
;;(require 'hack-quail)
;;(require 'czech)
;;(load "/usr/bin/czech.el")
;;(require 'hack-quail)
;;(require 'czech)
(set-language-environment "czech")
;;(setq default-input-method "czech-querty")
(setq default-input-method "czech-prog-3")
;;(require 'czech-calendar) -- jan no
;;(require 'cz-print) ;;-- jan no
;; vdiff
;;(load "/mnt/matylda3/karafiat/BABEL/GIT/emacs-vdiff/vdiff.el")
;;(if window-system
;; (setq clipboard-coding-system 'latin-2)
;; (set-terminal-coding-system 'latin-2))
;;(setq process-coding-system-alist '((".*" . iso-8859-2)))
(setq dos-codepage 852)
(setq default-enable-multibyte-characters t)
;;;;; od Vaska pro psani prehlasek - budou jako aouy s hackem !
;;;;; nejak to nechodi ...
;;(global-set-key "+a" '(lambda() (interactive) (insert 228)));
;;(global-set-key "+A" '(lambda() (interactive) (insert 196)));
;;;; (global-set-key "+f" '(lambda() (interactive) (insert 235)));
;;;; (global-set-key "+F" '(lambda() (interactive) (insert 203)));
;;(global-set-key "+o" '(lambda() (interactive) (insert 246)));
;;(global-set-key "+O" '(lambda() (interactive) (insert 214)));
;;(global-set-key "+y" '(lambda() (interactive) (insert 252)));
;;(global-set-key "+Y" '(lambda() (interactive) (insert 220)));
(put 'upcase-region 'disabled nil)
;; My section
(global-set-key (kbd "C-x C-f") 'ffap)
(normal-erase-is-backspace-mode 0)
;; set shel indent to 2 instead def 4
(setq sh-basic-offset 2)
;; make trailing whitespaces to red
(setq-default show-trailing-whitespace t)
(setq-default indicate-empty-lines t)
;; set spaces instead of tabs
(setq-default indent-tabs-mode nil)
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)
;; To install package (for example markdown)
;; M-x package-install RET markdown-mode RET