-
Notifications
You must be signed in to change notification settings - Fork 0
/
.emacs
executable file
·248 lines (201 loc) · 8.59 KB
/
.emacs
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
;; -------------------------------------------------------------------------
;; .emacs -- my personnal Emacs Init File
;; see http://julien.frenchlabs.net
;;
;; Copyright (c) 1991-2011 Julien Di Marco <juliendimarco@me.com>
;; http://julien.frenchlabs.net
;;
;; -------------------------------------------------------------------------
;;
;; ___ _ __ ___ __ _ ___ ___
;; / _ \ '_ ` _ \ / _` |/ __/ __|
;; | __/ | | | | | (_| | (__\__ \
;; (_)___|_| |_| |_|\__,_|\___|___/
;;
;;
;;
;; -------------------------------------------------------------------------
;; =====================
;; OLD BOCAL STUFF
;; =====================
;; BOCAL STAFF 2010-2011
;; FEDORA DUMP
;;(load "std.el")
;;(load "std_comment.el")
;;(if (file-exists-p "~/.myemacs")
;; (load-file "~/.myemacs"))
;; END BOCAL CONFIG
;; =========================
;; Environment determination
;; =========================
;; === Load path etc. ===
;;(add-to-list 'load-path "~/.emacs.d/")
(add-to-list 'load-path "~/.emacs.d/defaults")
(add-to-list 'load-path "~/.emacs.d/color-theme/") ; color-theme Themes
(add-to-list 'load-path "~/.emacs.d/site-lisp/") ; external elisp files
(add-to-list 'load-path "~/.emacs.d/site-lisp/color-theme/") ; Color-Theme Porta
;; =====================
;; Definition & Load
;; =====================
(require 'default) ; see ~/.emacs.d/default.el
(require 'display) ; see ~/.emacs.d/display.el
(require 'defuns) ; see ~/.emacs.d/defuns.el
(require 'bindings) ; see ~/.emacs.d/bindings.el
;; =====================
;; General Emacs Options
;; =====================
;; == UTF-8 Unicode Encoding
(prefer-coding-system 'utf-8)
;; === User authentication ===
(setq user-full-name "Julien Di Marco")
(setq user-mail-address "<juliendimarco@me.com>")
;; for the webpage url, see Auto-insert section
;; Turn off mouse interface early in staptup to avoid momentary display
;; You really don't need these (except perhaps the menu-bar); trust me.
;;(if (fboundp 'menu-bar-mode) (menu-bar-mode nil))
(if (fboundp 'tool-bar-mode) (tool-bar-mode nil))
;; scroll bar may be useful - replace 't' by 'nil' to disable right scrollbar
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode nil))
(setq buffers-menu-max-size nil) ; no buffer max-size
(setq truncate-partial-width-windows nil)
(setq line-number-mode t)
(setq column-number-mode t)
(setq search-highlight t) ; highlight search object
(setq query-replace-highlight t) ; highlight query object
(auto-compression-mode t) ; transparently edit compressed files
(column-number-mode t) ; column number in graphical
(setq byte-compile-verbose nil)
;;(setq visible-bell t) ; Make screen blink at end & start - disturbing
(setq initial-major-mode 'text-mode) ; to avoid autoloads for lisp mode
;;(setq require-final-newline t) ; ensure a file ends in a newline when it
; is saved
(setq show-trailing-whitespace t) ; color whitespace in red
(setq-default show-trailing-whitespace t)
;; === Auto-save and backup files ===
(setq auto-save-list-file-name nil) ; no .saves files
(setq auto-save-default t) ; auto saving
(setq make-backup-files nil) ; make backup files "~" (t = true - nil = false)
;; see http://www.emacswiki.org/emacs/BackupDirectory
(setq
backup-by-copying t ; don't clobber symlinks
backup-directory-alist
'(("." . "~/.saves")) ; don't litter my fs tree
delete-old-versions t ; delete excess backup versions
; silently
kept-new-versions 6
kept-old-versions 2
version-control t) ; make numeric backup versions
;; TODO: check out backup-dir
;; === Auto-fill configuration ===
;; automatic wrapping of lines and insertion of newlines when the cursor
;; goes over the column limit.
(setq-default fill-column 80)
(setq auto-fill-mode t) ; activate by default
;; ============================================================
;; These should be loaded on startup rather than autoloaded
;; on demand since they are likely to be used in every session
;; =====================
;; Additional Mode/Init
;; =====================
;; === line colums ===
(require 'linum)
(setq linum-format "%d ")
(global-linum-mode)
(setq linum-format
(lambda (line)
(propertize (format
(let ((w (length (number-to-string
(count-lines (point-min) (point-max))))))
(concat "%" (number-to-string w) "d "))
line)
'face 'linum)))
;; === Better search form [Alex Strzel INSIDE] ===
(require 'iswitchb nil t)
(when (fboundp 'iswitchb-default-keybindings)
(iswitchb-default-keybindings))
;; == Better search in file/buffer input
(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
;; === Htmlize Mode ===
(require 'htmlize)
;; === Sessions Saving Mode ===
(require 'saveplace) ; Saving Emacs Sessions
(setq-default save-place t) ; (cursor position etc. )
;; === Uniquify Mode for buffer Name ===
(require 'uniquify) ; Unique buffer names dependent on file name
(setq uniquify-buffer-name-style 'forward) ; Use names with parts of directory
;; === Maintain last change time stamps (via Time-stamp: <>) ===
(require 'time-stamp)
;; format of the string inserted by `M-x time-stamp'
;; `Weekday YYYY-MM-DD HH:MM USER'
(setq time-stamp-format "%3a %:y-%02m-%02d %02H:%02M %u")
(add-hook 'write-file-hooks 'time-stamp) ; update at buffer-saving
;; === Show matching parenthesis ===
(require 'paren)
(show-paren-mode t)
(set-face-foreground 'show-paren-mismatch-face "red") ; set the scope color
(set-face-attribute 'show-paren-mismatch-face nil
:weight 'bold :underline t :overline nil :slant 'normal)
;; === Show whitespaces/tabs etc. ===
;; make whitespace-mode use “¶” for newline and “▷” for tab.
;; together with the rest of its defaults
(setq whitespace-display-mappings
'(
(space-mark 32 [183] [46]) ; normal space, ·
(space-mark 160 [164] [95])
(space-mark 2208 [2212] [95])
(space-mark 2336 [2340] [95])
(space-mark 3616 [3620] [95])
(space-mark 3872 [3876] [95])
(newline-mark 10 [182 10]) ; newlne, ¶
(tab-mark 9 [8677 9] [92 9]) ; tab, ⇥
))
(setq x-stretch-cursor t)
(require 'show-wspace)
;;(add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs)
;; === Indenting configuration ===
;; see http://www.emacswiki.org/emacs/IndentationBasics
(setq-default indent-tabs-mode nil) ; indentation can't insert tabs
(setq indent-tabs-mode nil)
(setq-default tab-width 2)
(setq tab-width 2)
(setq indent-line-function 'insert-tab)
(setq tab-stop-list (number-sequence 4 120 4)) ; tab-to-tab stop list (M-i)
;;(setq c-brace-offset 2)
;; Overwrite major-mode - In fact mode like makefile are forced to do it
;; (add-hook 'after-change-major-mode-hook
;; '(lambda ()
;; (setq-default indent-tabs-mode nil) ; indentation can't insert tabs
;; (setq indent-tabs-mode nil)
;; (setq-default tab-width 2)
;; (setq tab-width 2)
;; (setq indent-line-function 'insert-tab)
;; (setq tab-stop-list (number-sequence 2 120 2))))
(defvaralias 'c-basic-offset 'tab-width) ; use previous var
(defvaralias 'cperl-indent-level 'tab-width)
;; Automatic indentation of pasted text like in TextMate
;; See M-v command in init-bindings.el for yand-and-indent
;; === Auto-complete ===
;; Manual: http://cx4a.org/software/auto-complete/manual.html
;; EmacsWiki: http://www.emacswiki.org/emacs/AutoComplete
(require 'auto-complete)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/site-lisp/ac-dict/")
;; = Loading Extension
(load-library "clang-completion-mode")
(require 'auto-complete-extension)
(if (not (eq system-type 'darwin))
(ac-config-default)
)
;; ==============================================================
;; Autopair: Automagically pair braces and quotes like TextMate
;; see http://code.google.com/p/autopair/ or
;; http://www.emacswiki.org/emacs/AutoPairs
;; ==============================================================
;;(require 'autopair)
;;(autopair-global-mode) ;; enable autopair in all buffers
;;(setq autopair-autowrap t)
;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;; EOF