-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemacs_init.el
330 lines (276 loc) · 10.7 KB
/
emacs_init.el
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
(setq user-full-name "Fabien Cesari"
user-mail-address "[email protected]")
(add-to-list 'load-path "~/.emacs.d/external/")
(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.
'(default ((t (:background "black" :foreground "grey"))))
'(fringe ((t (:background "black")))))
;; change window focus with shift-arrows
;;(require 'windmove)
(windmove-default-keybindings)
(setq windmove-wrap-around t)
(require 'buffer-move)
;;Key bindings
(global-set-key (kbd "C-+") 'hs-toggle-hiding)
(add-hook 'c-mode-common-hook 'hs-minor-mode)
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
(add-hook 'java-mode-hook 'hs-minor-mode)
(add-hook 'espresso-mode-hook 'hs-minor-mode)
(add-hook 'lisp-mode-hook 'hs-minor-mode)
(add-hook 'perl-mode-hook 'hs-minor-mode)
(add-hook 'sh-mode-hook 'hs-minor-mode)
(global-set-key (kbd "<C-S-up>") 'buf-move-up)
(global-set-key (kbd "<C-S-donw>") 'buf-move-down)
(global-set-key (kbd "<C-S-left>") 'buf-move-left)
(global-set-key (kbd "<C-S-right>") 'buf-move-right)
;;; I prefer cmd key for meta
(setq mac-command-modifier 'meta)
(setq mac-right-option-modifier nil)
;;; Remove Distracions on startup
;;No splash screen
(setq inhibit-startup-screen t)
;; Prevent the cursor from blinking
(blink-cursor-mode 0)
;; Don't use messages that you don't read
(setq initial-scratch-message "")
(setq inhibit-startup-message t)
;; Don't let Emacs hurt your ears
;;(setq visible-bell t)
;; You need to set `inhibit-startup-echo-area-message' from the
;; customization interface:
;; M-x customize-variable RET inhibit-startup-echo-area-message RET
;; then enter your username
(setq inhibit-startup-echo-area-message "cesari")
;; This is bound to f11 in Emacs 24.4
;;(toggle-frame-fullscreen)
(set-frame-parameter nil 'fullscreen 'fullboth)
;; Who use the bar to scroll?
(scroll-bar-mode 0)
;;No toolbar
;;(tool-bar-mode 0)
(tool-bar-mode -1)
(menu-bar-mode 0)
;; You can also set the initial frame parameters
;; (setq initial-frame-alist
;; '((menu-bar-lines . 0)
;; (tool-bar-lines . 0)))
;; No mode line
(defvar-local hidden-mode-line-mode nil)
(defvar-local hide-mode-line nil)
(define-minor-mode hidden-mode-line-mode
"Minor mode to hide the mode-line in the current buffer."
:init-value nil
:global nil
:variable hidden-mode-line-mode
:group 'editing-basics
(if hidden-mode-line-mode
(setq hide-mode-line mode-line-format
mode-line-format nil)
(setq mode-line-format hide-mode-line
hide-mode-line nil))
(force-mode-line-update)
;; Apparently force-mode-line-update is not always enough to
;; redisplay the mode-line
(redraw-display)
(when (and (called-interactively-p 'interactive)
hidden-mode-line-mode)
(run-with-idle-timer
0 nil 'message
(concat "Hidden Mode Line Mode enabled. "
"Use M-x hidden-mode-line-mode to make the mode-line appear."))))
;; Activate hidden-mode-line-mode
;;(hidden-mode-line-mode 1)
;; If you want to hide the mode-line in all new buffers
;;(add-hook 'after-change-major-mode-hook 'hidden-mode-line-mode)
;; Alternatively, you can paint your mode-line in White but then
;; you'll have to manually paint it in black again
;; (custom-set-faces
;; '(mode-line-highlight ((t nil)))
;; '(mode-line ((t (:foreground "white" :background "white"))))
;; '(mode-line-inactive ((t (:background "white" :foreground "white")))))
;; A small minor mode to use a big fringe
(defvar bzg-big-fringe-mode nil)
(define-minor-mode bzg-big-fringe-mode
"Minor mode to use big fringe in the current buffer."
:init-value nil
:global t
:variable bzg-big-fringe-mode
:group 'editing-basics
(if (not bzg-big-fringe-mode)
(set-fringe-style nil)
(set-fringe-mode
(/ (- (frame-pixel-width)
(* 100 (frame-char-width)))
2))))
;; Now activate this global minor mode
(bzg-big-fringe-mode 1)
;; To activate the fringe by default and deactivate it when windows
;; are split vertically, uncomment this:
;; (add-hook 'window-configuration-change-hook
;; (lambda ()
;; (if (delq nil
;; (let ((fw (frame-width)))
;; (mapcar (lambda(w) (< (window-width w) fw))
;; (window-list))))
;; (bzg-big-fringe-mode 0)
;; (bzg-big-fringe-mode 1))))
;; Use a minimal cursor
;; (setq default-cursor-type 'hbar)
;; Get rid of the indicators in the fringe
(mapcar (lambda(fb) (set-fringe-bitmap-face fb 'org-hide))
fringe-bitmaps)
;; Set the color of the fringe
;;(custom-set-faces
;;'(fringe ((t (:background "white")))))
;;Background color
(custom-set-faces
'(default ((t (:background "black" :foreground "grey"))))
'(fringe ((t (:background "black")))))
;;; emacs auto generate
(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.
'(gdb-max-frames 100)
'(global-subword-mode t)
'(ido-enable-flex-matching t)
'(ido-everywhere t)
'(ido-mode (quote both) nil (ido))
'(tool-bar-mode t))
(set-face-attribute 'default nil :height 120)
(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.
)
;; -*- mode: elisp -*-
;; Disable the splash screen (to enable it agin, replace the t with 0)
(setq inhibit-splash-screen t)
;; Enable transient mark mode
(transient-mark-mode 1)
;;;;Org mode configuration
;; Enable Org mode
(require 'org)
;; Make Org mode work with files ending in .org
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
;; The above is the default in recent emacsen
;; Set to the location of your Org files on your local system
(setq org-directory "~/work/org")
;; Set to the name of the file where new notes will be stored
(if (file-exists-p "~/work/org/flagged.org")
(setq org-mobile-inbox-for-pull "~/work/org/flagged.org")
)
;; Set to <your Dropbox root directory>/MobileOrg.
(setq org-mobile-directory "~/Dropbox/Applications/MobileOrg")
;;Load agneda files.
(if (file-exists-p "~/work/org/agenda.org")
(setq org-agenda-files (list "~/work/org/agenda.org"))
)
;;LaTeX export
(require 'ox-latex)
(unless (boundp 'org-export-latex-classes)
(setq org-export-latex-classes nil))
(add-to-list 'org-export-latex-classes
'("article"
"\\documentclass{article}"
("\\section{%s}" . "\\section*{%s}")))
(require 'ox-publish)
(setq org-publish-project-alist
'(
;;Path to org files
("org-notes"
:base-directory "~/work/website/org/"
:base-extension "org"
;;Path to jekyll
:publishing-directory "~/work/website/docs"
:recursive t
:publishing-function org-html-publish-to-html
:headline-levels 4
:html-extension "html"
:body-only t
)
("org-static"
:base-directory "~/work/website/org/"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
:publishing-directory "~/work/website/docs"
:recursive t
:publishing-function org-publish-attachment
)
("org" :components ("org-notes" "org-static")) ;;org is the project name here
))
(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.
'(org-agenda-files (quote ("~/work/org/ical.org" "~/work/org/everything.org" "~/work/org/agenda.org")))
)
(add-to-list 'org-modules 'org-mac-iCal)
(setq org-agenda-include-diary t)
(load "org-static-blog.el")
(setq org-static-blog-publish-title "cesari.studio")
(setq org-static-blog-publish-url "https://www.cesari.studio/")
(setq org-static-blog-publish-directory "~/work/blog/")
(setq org-static-blog-posts-directory "~/work/blog/posts/")
(setq org-static-blog-drafts-directory "~/work/blog/drafts/")
(setq org-static-blog-enable-tags t)
(setq org-export-with-toc nil)
(setq org-export-with-section-numbers nil)
;; This header is inserted into the <head> section of every page:
;; (you will need to create the style sheet at
;; ~/work/blog/static/style.css
;; and the favicon at
;; ~/work/blog/static/favicon.ico)
(setq org-static-blog-page-header
"<meta name=\"author\" content=\"Fabien Cesari\">
<meta name=\"referrer\" content=\"no-referrer\">
<link href= \"static/style.css\" rel=\"stylesheet\" type=\"text/css\" />
<link rel=\"icon\" href=\"static/favicon.ico\">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=\"https://www.googletagmanager.com/gtag/js?id=G-1J5LZRTXCB\"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1J5LZRTXCB');
</script>
" )
;; This preamble is inserted at the beginning of the <body> of every page:
;; This particular HTML creates a <div> with a simple linked headline
(setq org-static-blog-page-preamble
"<div class=\"container\">
<header class=\"masthead\">
<h1 class=\"masthead-title\">
<a href=\"/\" title=\"Home\">cesari.studio</a>
</h1>
<ul class=\"nav\">
<li><a href=\"/\">Home</a></li>
<li><a href=\"/projects.html\">Projects</a></li>
<li><a href=\"about.html\">About</a></li>
</ul>
</header>
</Div>" )
;; This postamble is inserted at the end of the <body> of every page:
;; This particular HTML creates a <div> with a link to the archive page
;; and a licensing stub.
(setq org-static-blog-page-postamble
"")
;; This HTML code is inserted into the index page between the preamble and
;; the blog posts
(setq org-static-blog-index-front-matter
"")
(add-to-list 'auto-mode-alist (cons (concat org-static-blog-posts-directory ".*\\.org\\'") 'org-static-blog-mode))
(load "org-journal.el")
(add-to-list 'load-path "~/.emacs.d/external/haskell-mode/")
(require 'haskell-mode-autoloads)
(add-to-list 'Info-default-directory-list "~/.emacs.d/external/haskell-mode/")
;; Paste path from above, appending "/scel/el"
(add-to-list 'load-path "/home/fabien/.local/share/SuperCollider/downloaded-quarks/scel/el")
(require 'sclang)
;; in ~/.emacs - for help browser
(require 'w3m)