-
Notifications
You must be signed in to change notification settings - Fork 0
/
.emacs
159 lines (137 loc) · 6.47 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
;; Custom
(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.
'(column-number-mode t)
'(display-time-mode t)
'(proof-three-window-mode-policy (quote hybrid))
'(safe-local-variable-values (quote ((checkdoc-minor-mode . t) (require-final-newline . t) (mangle-whitespace . t))))
'(show-paren-mode t)
'(tool-bar-mode nil)
'(exec-path-from-shell-variables '("PATH" "MANPATH" "SHELL")))
(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.
'(proof-locked-face ((t (:background "#111111"))))
'(proof-queue-face ((t (:background "#222222")))))
;; Package
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
(mapc
(lambda (package)
(or (package-installed-p package)
(if (y-or-n-p (format "Package %s is missing. Install it? " package))
(package-install package))))
'(color-theme zenburn-theme color-theme-solarized
exec-path-from-shell
auctex
magit
zotelo
tuareg scala-mode2 coffee-mode haskell-mode markdown-mode markdown-mode+ paredit))
;; Desktop
(desktop-save-mode t)
;; Buffers
(global-auto-revert-mode t)
(setq global-auto-revert-non-file-buffers t)
(global-set-key [(ctrl tab)] 'select-next-window)
(global-set-key [(ctrl shift tab)] 'select-previous-window)
(global-set-key "\C-x\C-k" 'kill-this-buffer)
(global-set-key "\C-x\C-n" 'next-buffer)
(global-set-key "\C-x\C-b" 'ibuffer)
(defun select-next-window ()
(interactive)
(select-window (next-window (selected-window))))
(defun select-previous-window ()
(interactive)
(select-window (previous-window (selected-window))))
;; Auto-save
(setq auto-save-default nil)
(setq auto-save-list-file-name nil)
(setq make-backup-files nil)
;; Path
(setq explicit-shell-file-name "/bin/zsh")
(exec-path-from-shell-initialize)
;; Language
(set-language-environment 'UTF-8)
(set-language-environment-input-method "Korean")
(set-input-method 'korean-hangul)
(toggle-input-method)
;; Key binding
(defalias 'yes-or-no-p 'y-or-n-p)
(global-set-key "\C-s" 'isearch-forward-regexp)
(global-set-key "\C-r" 'isearch-backward-regexp)
(global-set-key "\C-c\C-q" 'comment-or-uncomment-region)
(global-set-key "\C-w" 'clipboard-kill-region)
(global-set-key "\M-w" 'clipboard-kill-ring-save)
(global-set-key "\C-m" 'newline-and-indent)
(global-set-key "\C-z" 'eshell)
(global-set-key [(ctrl return)] 'ff-find-other-file)
;; Theme
(require 'color-theme)
(load-theme 'solarized-dark t)
(set-default-font "Menlo for Powerline 16")
(global-font-lock-mode t)
(setq initial-scratch-message "")
(setq inhibit-startup-screen t)
(setq search-highlight t)
(setq query-replace-highlight t)
;; Syntax
(setq auto-fill-mode t)
(setq standard-indent 2)
(setq default-tab-width 2)
(setq indent-tabs-mode nil)
(setq default-tabs-mode nil)
;; Magit
(global-set-key (kbd "C-x g") 'magit-status)
;; Mail
(setq user-mail-address "[email protected]")
;; Uniquify
(require 'uniquify)
(setq
uniquify-buffer-name-style 'forward
uniquify-separator "/")
;; Shell
(add-to-list 'auto-mode-alist '(".*.csh\\'" . shell-script-mode))
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; ProofGeneral
(load-file "~/.emacs.d/ProofGeneral-4.2/generic/proof-site.el")
(setq proof-three-window-enable t)
(setq proof-shell-process-connection-type nil)
(add-to-list 'auto-mode-alist '(".*.v\\'" . coq-mode))
;; C
(setq c-basic-offset 2)
(setq c-offsets-alist
'((substatement-open . 0)))
;; TeX
(require 'tex-site)
(load "preview-latex.el" nil t t)
(add-hook 'TeX-mode-hook
'(lambda ()
(define-key TeX-mode-map "\C-c\C-z" 'TeX-home-buffer)))
(require 'reftex)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq LaTeX-command "latex -shell-escape")
(setq TeX-PDF-mode t)
(setq TeX-command-list (quote (("TeX" "%(PDF)%(tex) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (plain-tex-mode texinfo-mode ams-tex-mode) :help "Run plain TeX") ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") ("Makeinfo" "makeinfo %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info output") ("Makeinfo HTML" "makeinfo --html %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML output") ("AmSTeX" "%(PDF)amstex %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX") ("ConTeXt" "texexec --once --texutil %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt once") ("ConTeXt Full" "texexec %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until completion") ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX") ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file") ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible TeX-queue-command) ("File" "%(o?)dvips %d -o %f " TeX-run-command t t :help "Generate PostScript file") ("Index" "makeindex %s" TeX-run-command nil t :help "Create index file") ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for correctness") ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files") ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files") ("Other" "" TeX-run-command t t :help "Run an arbitrary command") ("XeLaTeX" "xelatex %t" TeX-run-command nil (latex-mode) :help "Run XeLaTeX"))))
;; Racket
(add-to-list 'auto-mode-alist '(".*.rkt\\'" . scheme-mode))
(add-hook 'scheme-mode-hook (lambda () (paredit-mode t)))
;; Mac
(if (eq system-type 'darwin)
(progn
(setq mac-command-modifier 'meta)
(setq TeX-view-program-list (quote (("Skim" ("open %o")))))
(setq TeX-view-program-selection
(quote (((output-dvi style-pstricks) "dvips and gv") (output-dvi "xdvi") (output-pdf "Skim") (output-html "xdg-open"))))
))
;; Ispell
(setq-default ispell-program-name "aspell")
(ispell-change-dictionary "english")