View difference between Paste ID: 1Znm91h3 and sKLzszBF
SHOW: | | - or go back to the newest paste.
1
;;; Customize Variables and Custom Faces:
2
(custom-set-variables
3
 ;; custom-set-variables was added by Custom.
4
 ;; If you edit it by hand, you could mess it up, so be careful.
5
 ;; Your init file should contain only one such instance.
6
 ;; If there is more than one, they won't work right.
7
 '(calendar-latitude 39.55)
8
 '(calendar-longitude 116.23)
9
 '(cfs--current-profile "profile2" t)
10
 '(cfs--profiles-steps
11
   (quote
12
    (("profile2" . 3)
13
     ("profile3" . 7)
14
     ("profile1" . 7))) t)
15
 '(column-number-mode t)
16
 '(custom-safe-themes
17
   (quote
18
    ("55d31108a7dc4a268a1432cd60a7558824223684afecefa6fae327212c40f8d3" "1bd383f15ee7345c270b82c5e41554754b2a56e14c2ddaa2127c3590d0303b95" "3de3f36a398d2c8a4796360bfce1fa515292e9f76b655bb9a377289a6a80a132" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default)))
19
 '(delete-selection-mode nil)
20
 '(elpy-rpc-python-command "/Users/repl/Documents/PythonEnv/venv3.6.1/bin/python")
21
 '(exec-path
22
   (quote
23
    ("/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9" "/Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_9" "/Applications/Emacs.app/Contents/MacOS/libexec" "/Applications/Emacs.app/Contents/MacOS/bin" "/usr/local/bin")))
24
 '(global-linum-mode t)
25
 '(inhibit-default-init t)
26
 '(inhibit-startup-buffer-menu t)
27
 '(inhibit-startup-screen t)
28
 '(initial-buffer-choice nil)
29
 '(jdee-jdk-registry (quote (("1.8.0_112" . "/usr/lib64/jdk8u121_b13/"))))
30
 '(jdee-server-dir "/home/repl/Documents/Dot.emacs/extra/jdee-server/target")
31
 '(org-latex-compiler "xelatex")
32
 '(package-selected-packages
33
   (quote
34
    (yaml-mode autumn-light-theme org-tree-slide org-present epresent helm merlin utop inkpot-theme circe sphinx-doc fzf markdown-mode add-hooks jinja2-mode emmet-mode hexo jdee theme-changer solarized-theme chinese-pyim py-yapf company-mode rainbow-blocks rainbow-delimiters hl-sexp chinese-pyim-greatdict powerline robe haskell-mode bfbuilder geiser sml-mode elpy slime yasnippet chinese-fonts-setup magit color-moccur smart-mode-line counsel multiple-cursors expand-region lispy ace-jump-mode moccur-edit eclipse-theme use-package)))
35
 '(python-shell-interpreter "/Users/repl/Documents/PythonEnv/venv3.6.1/bin/python")
36
 '(ring-bell-function (quote ignore))
37
 '(safe-local-variable-values (quote ((encoding . utf-8))))
38
 '(sml-program-name "/usr/bin/poly")
39
 '(yas-snippet-dirs
40
   (quote
41
    ("~/Documents/Dot.emacs/snippets" yas-installed-snippets-dir))))
42
(custom-set-faces
43
 ;; custom-set-faces was added by Custom.
44
 ;; If you edit it by hand, you could mess it up, so be careful.
45
 ;; Your init file should contain only one such instance.
46
 ;; If there is more than one, they won't work right.
47
 '(rainbow-blocks-depth-1-face ((t (:foreground "#30A096"))))
48
 '(rainbow-blocks-depth-2-face ((t (:foreground "#D99D17"))))
49
 '(rainbow-blocks-depth-3-face ((t (:foreground "#349CEA"))))
50
 '(rainbow-blocks-depth-4-face ((t (:foreground "#EB531E"))))
51
 '(rainbow-blocks-depth-5-face ((t (:foreground "#99AE17"))))
52
 '(rainbow-blocks-depth-6-face ((t (:foreground "#D99D17"))))
53
 '(rainbow-blocks-depth-7-face ((t (:foreground "#349CEA"))))
54
 '(rainbow-blocks-depth-8-face ((t (:foreground "#EB531E"))))
55
 '(rainbow-blocks-depth-9-face ((t (:foreground "#99AE17"))))
56
 '(rainbow-delimiters-depth-1-face ((t (:foreground "#30A096"))))
57
 '(rainbow-delimiters-depth-2-face ((t (:foreground "#D99D17"))))
58
 '(rainbow-delimiters-depth-3-face ((t (:foreground "#349CEA"))))
59
 '(rainbow-delimiters-depth-4-face ((t (:foreground "#EB531E"))))
60
 '(rainbow-delimiters-depth-5-face ((t (:foreground "#99AE17"))))
61
 '(rainbow-delimiters-depth-6-face ((t (:foreground "#D99D17"))))
62
 '(rainbow-delimiters-depth-7-face ((t (:foreground "#349CEA"))))
63
 '(rainbow-delimiters-depth-8-face ((t (:foreground "#EB531E"))))
64
 '(rainbow-delimiters-depth-9-face ((t (:foreground "#99AE17")))))
65
66
;;; Initialize Emacs and prepare packages:
67
;; C-c @ C-t: show top level, C-c @ C-a: show all again.
68
(add-hook
69
 'emacs-lisp-mode-hook
70
 (lambda ()
71
   (make-local-variable
72
    'outline-regexp)
73
   (setq outline-regexp "^;;; ")
74
   (make-local-variable
75
    'outline-heading-end-regexp)
76
   (setq outline-heading-end-regexp
77
	 ":\n")
78
   (outline-minor-mode 1)))
79
(setq debug-on-error t)
80
(setq gc-cons-threshold 400000000)
81
(require 'package)
82
(setq package-archives
83
      '(;; ("gnu"   . "http://elpa.zilongshanren.com/gnu/")
84
	("gnu"   . "https://elpa.gnu.org/packages/")
85
	;; ("melpa" . "http://elpa.zilongshanren.com/melpa/")
86
	("melpa" . "https://melpa.org/packages/")
87
	("elpy" . "https://jorgenschaefer.github.io/packages/")))
88
(package-initialize)
89
(unless (package-installed-p 'use-package)
90
  (package-refresh-contents)
91
  (package-install 'use-package))
92
(eval-when-compile
93
  (require 'use-package))
94
(require 'server)
95
(or (server-running-p)
96
    (server-start))
97
(setq gc-cons-threshold 800000)
98
;; disable on 2017/04/28
99
(menu-bar-mode -1)
100
(tool-bar-mode -1)
101
(scroll-bar-mode -1)
102
(setq-default tramp-ssh-controlmaster-options nil)
103
;; 2017/01/09
104
(setq prettify-symbols-alist '(("lambda" . 955)))
105
(global-prettify-symbols-mode 1)
106
(add-to-list 'load-path
107
	     "~/Documents/Dot.emacs/extra")
108
;; 2017/03/14
109
;; (load-theme 'tango-dark t)
110
;; (load-theme 'adwaita t)
111
112
;; 五  8/11 15:38:58 2017
113
;; (load-theme 'base16-brewer t)
114
115
;; 2017/02/16
116
;; org-mode configuration
117
(global-set-key "\C-cl" 'org-store-link)
118
(global-set-key "\C-ca" 'org-agenda)
119
(global-set-key "\C-cc" 'org-capture)
120
(global-set-key "\C-cb" 'org-iswitchb)
121
122
;; 2017/05/16
123
(global-set-key (kbd "<f9>") 'compile)
124
(global-set-key (kbd "<f12>") 'eshell)
125
(global-set-key (kbd "<f5>") 'gdb)
126
(setq gdb-many-windows t)
127
128
;; 2017/06/03
129
(define-key text-mode-map (kbd "<tab>") 'tab-to-tab-stop)
130
(setq tab-stop-list (number-sequence 2 160 2))
131
132
(defun set-tab-stop-width (width)
133
  "Set all tab stops to WIDTH in current buffer.
134
    
135
    This updates `tab-stop-list', but not `tab-width'.
136
    
137
    By default, `indent-for-tab-command' uses tabs to indent, see
138
    `indent-tabs-mode'."
139
  (interactive "nTab width: ")
140
  (let* ((max-col (car (last tab-stop-list)))
141
	 ;; If width is not a factor of max-col,
142
	 ;; then max-col could be reduced with each call.
143
	 (n-tab-stops (/ max-col width)))
144
    (set (make-local-variable 'tab-stop-list)
145
	 (mapcar (lambda (x) (* width x))
146
		 (number-sequence 1 n-tab-stops)))
147
    ;; So preserve max-col, by adding to end.
148
    (unless (zerop (% max-col width))
149
      (setcdr (last tab-stop-list)
150
	      (list max-col)))))
151
152
(defun local-text-mode-hook-fun ()
153
  (set-tab-stop-width 2)
154
  (setq indent-tabs-mode nil))
155
156
(add-hook 'text-mode-hook 'local-text-mode-hook-fun)
157
(add-hook 'python-mode-hook 'local-text-mode-hook-fun)
158
(add-hook 'ruby-mode-hook 'local-text-mode-hook-fun)
159
160
(global-set-key (kbd "C-x r p") 'query-replace-regexp)
161
162
;; 2017/09/05
163
(setenv "PATH" (concat "/Library/TeX/texbin" ":" (getenv "PATH")))
164
165
;;; Packages:
166
(setq use-package-always-ensure t)
167
(use-package slime
168
  :config
169
  (slime-setup '(slime-fancy)))
170
(use-package yasnippet
171
  :init
172
  (yas-global-mode 1))
173
(use-package chinese-fonts-setup
174
  :config
175
  (chinese-fonts-setup-enable))
176
177
;; disable smart-mode-line on 2017/01/09
178
179
;; (use-package smart-mode-line
180
;;   :config
181
;;   (setq sml/theme 'light)
182
;;   (sml/setup))
183
184
;; disable on 2017/01/09
185
;; enable on 2017/03/15
186
187
;; (use-package eclipse-theme)
188
189
(use-package multiple-cursors
190
  :config
191
  (global-set-key (kbd "<f7>") 'mc/mark-next-like-this)
192
  (global-set-key (kbd "<f8>") 'mc/mark-previous-like-this)
193
  (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
194
  (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines))
195
(use-package counsel
196
  :config
197
  (global-set-key (kbd "M-x") 'counsel-M-x)
198
  (global-set-key (kbd "C-x C-f") 'counsel-find-file)
199
  (global-set-key (kbd "<f1> f") 'counsel-describe-function)
200
  (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
201
  (global-set-key (kbd "<f1> l") 'counsel-load-library)
202
  (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
203
  (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
204
  (global-set-key (kbd "C-c g") 'counsel-git)
205
  (global-set-key (kbd "C-c j") 'counsel-git-grep)
206
  (global-set-key (kbd "C-c k") 'counsel-ag)
207
  (global-set-key (kbd "C-x l") 'counsel-locate)
208
  (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
209
  (define-key read-expression-map (kbd "C-r") 'counsel-expression-history))
210
(use-package swiper
211
  :init
212
  (ivy-mode 1)
213
  (setq ivy-use-virtual-buffers t)
214
  :config
215
  (global-set-key "\C-s" 'swiper)
216
  (global-set-key (kbd "C-c C-r") 'ivy-resume)
217
  (global-set-key (kbd "<f6>") 'ivy-resume))
218
(use-package
219
  magit
220
  :config
221
  (global-set-key (kbd "C-x g") 'magit-status)
222
  (global-set-key (kbd "C-x M-g") 'magit-dispatch-popup))
223
(use-package ace-jump-mode
224
  :bind ("C-x j" . ace-jump-mode))
225
(use-package lispy
226
  :init
227
  (add-hook 'emacs-lisp-mode-hook
228
	    (lambda () (lispy-mode 1)))
229
  (add-hook 'lisp-mode-hook
230
	    (lambda () (lispy-mode 1)))
231
  (add-hook 'scheme-mode-hook
232
	    (lambda () (lispy-mode 1))))
233
(use-package hydra
234
  :config
235
  (defhydra hydra-zoom (global-map "<f2>")
236
    "zoom"
237
    ("g" text-scale-increase "in")
238
    ("l" text-scale-decrease "out")
239
    ("r" (text-scale-set 0) "reset")
240
    ("0" (text-scale-set 0) :bind nil :exit t)
241
    ("1" (text-scale-set 0) nil :bind nil :exit t))
242
  (defhydra hydra-buffer-menu (:color pink
243
				      :hint nil)
244
    "
245
^Mark^             ^Unmark^           ^Actions^          ^Search
246
^^^^^^^^-----------------------------------------------------------------
247
_m_: mark          _u_: unmark        _x_: execute       _R_: re-isearch
248
_s_: save          _U_: unmark up     _b_: bury          _I_: isearch
249
_d_: delete        ^ ^                _g_: refresh       _O_: multi-occur
250
_D_: delete up     ^ ^                _T_: files only: % -28`Buffer-menu-files-only
251
_~_: modified
252
"
253
    ("m" Buffer-menu-mark)
254
    ("u" Buffer-menu-unmark)
255
    ("U" Buffer-menu-backup-unmark)
256
    ("d" Buffer-menu-delete)
257
    ("D" Buffer-menu-delete-backwards)
258
    ("s" Buffer-menu-save)
259
    ("~" Buffer-menu-not-modified)
260
    ("x" Buffer-menu-execute)
261
    ("b" Buffer-menu-bury)
262
    ("g" revert-buffer)
263
    ("T" Buffer-menu-toggle-files-only)
264
    ("O" Buffer-menu-multi-occur :color blue)
265
    ("I" Buffer-menu-isearch-buffers :color blue)
266
    ("R" Buffer-menu-isearch-buffers-regexp :color blue)
267
    ("c" nil "cancel")
268
    ("v" Buffer-menu-select "select" :color blue)
269
    ("o" Buffer-menu-other-window "other-window" :color blue)
270
    ("q" quit-window "quit" :color blue))
271
  (define-key Buffer-menu-mode-map "." 'hydra-buffer-menu/body)
272
  (defhydra hydra-window (:color red
273
				 :columns nil)
274
    "window"
275
    ("h" windmove-left nil)
276
    ("j" windmove-down nil)
277
    ("k" windmove-up nil)
278
    ("l" windmove-right nil)
279
    ("H" hydra-move-splitter-left nil)
280
    ("J" hydra-move-splitter-down nil)
281
    ("K" hydra-move-splitter-up nil)
282
    ("L" hydra-move-splitter-right nil)
283
    ("v" (lambda ()
284
	   (interactive)
285
	   (split-window-right)
286
	   (windmove-right))
287
     "vert")
288
    ("x" (lambda ()
289
	   (interactive)
290
	   (split-window-below)
291
	   (windmove-down))
292
     "horz")
293
    ("t" transpose-frame "'" :exit t)
294
    ("o" delete-other-windows "one" :exit t)
295
    ("a" ace-window "ace")
296
    ("s" ace-swap-window "swap")
297
    ("d" ace-delete-window "del")
298
    ("i" ace-maximize-window "ace-one" :exit t)
299
    ("b" ido-switch-buffer "buf")
300
    ("m" headlong-bookmark-jump "bmk")
301
    ("q" nil "cancel")
302
    ("u" (progn (winner-undo) (setq this-command 'winner-undo)) "undo")
303
    ("f" nil))
304
  (global-set-key (kbd "C-M-o") 'hydra-window/body))
305
(use-package ace-window
306
  :init
307
  (bind-key "M-p" 'ace-window)
308
  (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
309
(use-package expand-region
310
  :ensure expand-region
311
  :bind ("C-=" . er/expand-region))
312
313
;; 2016/12/11
314
315
(use-package
316
  elpy
317
  :init (elpy-enable)
318
  :config (setq elpy-rpc-backend "jedi")
319
  (elpy-use-ipython)
320
  :bind
321
  ("C-c <down>" . elpy-nav-forward-block)
322
  ("C-c <up>" . elpy-nav-backward-block)
323
  ("C-c <left>" . elpy-nav-backward-indent)
324
  ("C-c <right>" . elpy-nav-forward-indent)
325
  ("C-c f" . elpy-autopep8-fix-code)
326
  ("M-*" . pop-tag-mark)
327
  ("C-<tab>" . elpy-company-backend))
328
329
;; 2017/01/05
330
(use-package hl-sexp
331
  :config
332
  (add-hook 'lisp-mode-hook
333
	    #'hl-sexp-mode))
334
;; 2017/01/09
335
336
;; rainbow-delimiters will determin the color-theme based on this
337
;; variable
338
(setq frame-background-mode 'light)
339
(use-package rainbow-delimiters
340
  :config
341
  (add-hook 'emacs-lisp-mode-hook
342
	    #'rainbow-delimiters-mode)
343
  (add-hook 'lisp-mode-hook
344
	    #'rainbow-delimiters-mode)
345
  (add-hook 'scheme-mode-hook
346
	    #'rainbow-delimiters-mode))
347
(use-package rainbow-blocks
348
  :config
349
  (add-hook 'emacs-lisp-mode-hook
350
	    #'rainbow-blocks-mode)
351
  (add-hook 'lisp-mode-hook
352
	    #'rainbow-blocks-mode)
353
  (add-hook 'scheme-mode-hook
354
	    #'rainbow-blocks-mode))
355
;; (use-package solarized-theme
356
;;   :config
357
;;   ;; (load-theme 'solarized-dark)
358
;;   ;; (add-hook 'lisp-mode-hook
359
;;   ;; 	    (lambda ()
360
;;   ;; 	      (load-theme 'solarized-dark t)))
361
362
;;   (add-hook 'emacs-lisp-mode-hook
363
;;   	    (lambda ()
364
;;   	      (load-theme 'solarized-dark t))))
365
366
;; (use-package theme-changer
367
;;   :config
368
;;   (setq calendar-location-name "Beijing, China")
369
;;   (setq calendar-latitude 39.55)
370
;;   (setq calendar-longitude 116.23)
371
;;   ;; (change-theme 'base16-monokai
372
;;   ;; 		'base16-monokai)
373
374
;;   (change-theme 'solarized-light
375
;;   		'solarized-light))
376
377
;; Try highlight-sexps
378
379
(require 'highlight-sexps)
380
(add-hook 'emacs-lisp-mode-hook
381
	  #'highlight-sexps-mode)
382
(add-hook 'lisp-mode-hook
383
	  #'highlight-sexps-mode)
384
(add-hook 'scheme-mode-hook
385
	  #'highlight-sexps-mode)
386
387
;; For quicklisp-slime-helper
388
(let ((quicklisp-slime-helper
389
       (expand-file-name "~/quicklisp/slime-helper.el")))
390
  (when (file-exists-p quicklisp-slime-helper)
391
    (load quicklisp-slime-helper)))
392
393
;; 2016/12/30
394
;; (use-package fcitx
395
;;   :config
396
;;   (fcitx-aggressive-setup)
397
;;   (setq fcitx-use-dbus t))
398
399
;; 2017/01/16
400
(use-package sml-mode
401
  ;; `C-c C-s` start sml REPL
402
  )
403
;; 2017/01/25
404
(use-package geiser
405
  ;; `C-c C-a` runs the command geiser-mode-switch-to-repl-and-enter. `C-c C-k` compile current buffer, don't forget to add `#lang racket` and `(provide (all-defined-out))` at the beginning of source file. `C-c C-q` exit racket REPL. or `C-u C-c C-q`
406
  ;; There is a snippet named RACKETMLIMIT, it's used to limit memory used by racket. It can avoid Racket and Emacs get stuck when program is in indefinite loop.
407
  :config
408
  (setq geiser-active-implementations '(racket)))
409
;; 2017/01/26
410
(use-package bfbuilder
411
  :config
412
  (add-to-list 'auto-mode-alist '("\\.bf$" . bfbuilder-mode)))
413
;; 2017/01/30
414
(use-package haskell-mode
415
  :bind
416
  (("C-c C-l" . haskell-process-load-or-reload)
417
   ("C-c C-z" . haskell-interactive-bring)
418
   ("C-c C-t" . haskell-process-do-type)
419
   ("C-c C-i" . haskell-process-do-info)
420
   ("C-c C-c" . haskell-process-cabal-build)
421
   ("C-c C-k" . haskell-interactive-mode-clear)
422
   ("C-c C" . haskell-process-cabal)))
423
;; (use-package groovy-mode)
424
;; 2017/02/04
425
;; M-. to jump to the definition
426
;; M-, to jump back
427
;; C-c C-d to see the documentation
428
;; C-c C-k to refresh Rails environment
429
;; C-M-i to complete the symbol at point
430
431
(use-package robe
432
  :config
433
  (add-hook 'ruby-mode-hook
434
	    'robe-mode))
435
436
;; 2017/03/24
437
;; 2017/08/16
438
(use-package powerline
439
  :config
440
  ;; (powerline-center-theme)
441
  (setq ns-use-srgb-colorspace nil)
442
  (powerline-default-theme))
443
444
;; 2017/03/29
445
(use-package company
446
  :config
447
  ;; (add-hook 'after-init-hook 'global-company-mode)
448
  )
449
450
(use-package py-yapf
451
  :config
452
  (add-hook 'python-mode-hook 'py-yapf-enable-on-save))
453
454
(use-package chinese-pyim
455
  :ensure t
456
  :config
457
  ;; 激活 basedict 拼音词库
458
  (use-package chinese-pyim-basedict
459
    :ensure t
460
    :config (chinese-pyim-basedict-enable))
461
  
462
  (use-package chinese-pyim-greatdict
463
    :ensure t
464
    :config (chinese-pyim-greatdict-enable))
465
466
  (setq default-input-method "chinese-pyim")
467
468
  ;; 我使用全拼
469
  (setq pyim-default-scheme 'quanpin)
470
471
  ;; 设置 pyim 探针设置,这是 pyim 高级功能设置,可以实现 *无痛* 中英文切换 :-)
472
  ;; 我自己使用的中英文动态切换规则是:
473
  ;; 1. 光标只有在注释里面时,才可以输入中文。
474
  ;; 2. 光标前是汉字字符时,才能输入中文。
475
  ;; 3. 使用 M-j 快捷键,强制将光标前的拼音字符串转换为中文。
476
  (setq-default pyim-english-input-switch-functions
477
                '(pyim-probe-dynamic-english
478
                  pyim-probe-isearch-mode
479
                  pyim-probe-program-mode
480
                  pyim-probe-org-structure-template))
481
482
  (setq-default pyim-punctuation-half-width-functions
483
                '(pyim-probe-punctuation-line-beginning
484
                  pyim-probe-punctuation-after-punctuation))
485
486
  ;; 开启拼音搜索功能
487
  (setq pyim-isearch-enable-pinyin-search t)
488
489
  ;; 使用 pupup-el 来绘制选词框
490
  (setq pyim-page-tooltip 'pos-tip)
491
  (setq x-gtk-use-system-tooltips t)
492
493
  ;; 选词框显示5个候选词
494
  (setq pyim-page-length 5)
495
496
  ;; 让 Emacs 启动时自动加载 pyim 词库
497
  (add-hook 'emacs-startup-hook
498
            #'(lambda () (pyim-restart-1 t)))
499
  :bind
500
  (("M-j" . pyim-convert-code-at-point) ;与 pyim-probe-dynamic-english 配合
501
   ("C-;" . pyim-delete-word-from-personal-buffer)))
502
503
;; 2017/04/02
504
;; (use-package jdee)
505
506
;; 2017/04/11
507
(use-package hexo)
508
509
;; 2017/04/25
510
(use-package emmet-mode
511
  :config
512
  ;; Auto-start on any markup modes
513
  (add-hook 'sgml-mode-hook 'emmet-mode)
514
  ;; enable Emmet's css abbreviation
515
  (add-hook 'css-mode-hook  'emmet-mode))
516
517
(use-package jinja2-mode)
518
519
;; 2017/05/16
520
;; (use-package base16-theme)
521
522
;; 2017/06/17
523
(use-package ensime
524
  :ensure t)
525
526
;; 2017/07/06
527
(use-package markdown-mode
528
  :ensure t
529
  :commands (markdown-mode gfm-mode)
530
  :mode (("README\\.md\\'" . gfm-mode)
531
         ("\\.md\\'" . markdown-mode)
532
         ("\\.markdown\\'" . markdown-mode))
533
  :init (setq markdown-command "multimarkdown"))
534
535
;; 2017/07/16
536
;; Open .v files with Proof General's Coq mode
537
(load "~/Documents/Dot.emacs/extra/PG/generic/proof-site")
538
539
(use-package company-coq
540
  :ensure t
541
  :config (add-hook 'coq-mode-hook #'company-coq-mode))
542
543
;; 2017/08/04
544
;; (use-package auctex)
545
(load "auctex.el" nil t t)
546
(setq TeX-auto-save t)
547
(setq TeX-parse-self t)
548
(setq-default TeX-master nil)
549
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
550
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
551
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
552
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
553
(setq reftex-plug-into-AUCTeX t)
554
555
;; 2017/08/11
556
(use-package fzf)
557
558
;; 2017/08/15
559
(use-package
560
  sphinx-doc
561
  :config (add-hook
562
	   'python-mode-hook
563
	   (lambda ()
564
	     (require 'sphinx-doc)
565
	     (sphinx-doc-mode t))))
566
(use-package
567
  circe
568
  :init
569
  (load ".private.el")
570
  :config (setq circe-network-options
571
		`(("Freenode"
572
		   :tls t
573
		   :nick "abel-abel"
574
		   :sasl-username "abel-abel"
575
		   :sasl-password ,freenode-password
576
		   :channels ("#GentooWithoutJUJU"
577
			      "#archlinux-cn"
578
			      "#lisp"
579
			      "#lispgames"))))
580
  (setq circe-reduce-lurker-spam t))
581
582
;; 2017/08/16
583
;; (use-package inkpot-theme)
584
585
;; 2017/08/23
586
;; (use-package tuareg)
587
;; (use-package utop)
588
;; (use-package merlin)
589
;; (setq auto-mode-alist
590
;;       (append '(("\\.ml[ily]?$" . tuareg-mode)
591
;;                 ("\\.topml$" . tuareg-mode))
592
;;               auto-mode-alist)) 
593
;; (autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t)
594
;; (add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)
595
;; (add-hook 'tuareg-mode-hook 'merlin-mode)
596
;; (setq merlin-use-auto-complete-mode t)
597
;; (setq merlin-error-after-save nil)
598
;; 
599
;; 2017/08/24
600
(use-package helm)
601
(global-set-key (kbd "C-x x") 'helm-M-x)
602
603
;; 2017/09/05
604
(use-package epresent)
605
(use-package org-present)
606
(eval-after-load "org-present"
607
  '(progn
608
     (add-hook 'org-present-mode-hook
609
	       (lambda ()
610
		 (org-present-big)
611
		 (org-display-inline-images)
612
		 (org-present-hide-cursor)
613
		 (org-present-read-only)))
614
     (add-hook 'org-present-mode-quit-hook
615
	       (lambda ()
616
		 (org-present-small)
617
		 (org-remove-inline-images)
618
		 (org-present-show-cursor)
619
		 (org-present-read-write)))))
620
621
(use-package org-tree-slide
622
  :config
623
  (global-set-key (kbd "<f8>") 'org-tree-slide-mode)
624
  (global-set-key (kbd "S-<f8>") 'org-tree-slide-skip-done-toggle)
625
  (define-key org-tree-slide-mode-map (kbd "<f9>")
626
    'org-tree-slide-move-previous-tree)
627
  (define-key org-tree-slide-mode-map (kbd "<f10>")
628
    'org-tree-slide-move-next-tree)
629
  (define-key org-tree-slide-mode-map (kbd "<f11>")
630
    'org-tree-slide-content)
631
  (setq org-tree-slide-skip-outline-level 4)
632
  (org-tree-slide-narrowing-control-profile)
633
  (setq org-tree-slide-skip-done nil))
634
635
;; 2017/09/07
636
(use-package autumn-light-theme)
637
638
;; 2017/09/12
639
(use-package yaml-mode
640
  :config
641
  (add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
642
  (add-hook 'yaml-mode-hook
643
	    '(lambda ()
644
	       (define-key yaml-mode-map "\C-m" 'newline-and-indent))))
645
646
;;; Platform:
647
(cond
648
 ((string-equal system-type
649
		"darwin")
650
  (setq inferior-lisp-program "/usr/local/bin/sbcl")
651
  (setq initial-frame-alist
652
	'((width . 145) (height . 50))))
653
 ((string-equal system-type
654
		"gnu/linux")
655
  (setq initial-frame-alist '((width . 91) (height . 24)))
656
  (setq inferior-lisp-program "/usr/bin/clisp"))
657
 ((string-equal system-type
658
		"windows-nt")
659
  (setq initial-frame-alist '((width . 120) (height . 45)))))