forked from drewfrank/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.emacs
198 lines (181 loc) · 7.91 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
;; This .emacs file is based off of init.el from emacs-kicker.
;; It uses el-get to manage installed packages.
;; Personal add ons:
(require 'org)
;; Handy shortcuts
(global-set-key (kbd "<f3>") 'comment-region)
(global-set-key (kbd "<f4>") 'uncomment-region)
(global-set-key (kbd "<f5>") 'indent-region)
(global-set-key (kbd "<f11>") 'toggle-fullscreen)
(fset 'quckfn " <- ")
(global-set-key (kbd "M--") 'quickfn)
;; keybinding to start magit gui (for working with git repos)
(global-set-key (kbd "<f2>") 'magit-status)
;; Julia mode
(add-to-list 'load-path "~/julia/contrib/") ;Tell emacs to look for the file there.
(require 'julia-mode) ;Tell it to load it.
(setq auto-mode-alist ;Tell it to go to julia-mode when a Julia file(.jl) is spotted.
(append '(("\\.jl$" . julia-mode)) auto-mode-alist))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Other stuff
(require 'cl) ; common lisp goodies, loop
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil t)
(url-retrieve
"https://github.com/dimitri/el-get/raw/master/el-get-install.el"
(lambda (s)
(end-of-buffer)
(eval-print-last-sexp))))
;; Now either el-get is `require'd already, or have been `load'ed by the
;; el-get installer.
;; set local recipes -- ideally, keep this in separate files in a recipe
;; directory (just to keep .emacs clean)
(setq
el-get-sources '(
(:name magit
:after (progn (global-set-key (kbd "C-x C-z") 'magit-status))
)
(:name evil
:after (progn (evil-mode 0));1)) ;; TEMP: Don't load evil
)
)
)
;; Now set our own packages.
(setq
my:el-get-packages
'(
el-get ; el-get is self-hosting
auto-complete ; complete as you type with overlays
color-theme ; nice looking emacs
;; color-theme-solarized
;; color-theme-tomorrow
color-theme-twilight
color-theme-zenburn
ess
escreen ; screen for emacs, C-\ C-h
;; evil ; vim is in my blood
;; evil-surround ; cs"'
;; evil-numbers ; evil-numbers/{inc,dec}-at-pt
magit ; git integration
;; org-mode ; latest and greatest, please! (git HEAD)
zencoding-mode ; http://www.emacswiki.org/emacs/ZenCoding
))
;; Not sure what this does, but it seems important.
(setq my:el-get-packages
(append
my:el-get-packages
(loop for src in el-get-sources collect (el-get-source-name src))))
;;Install new packages and init already installed packages.
(el-get 'sync my:el-get-packages)
;; Basic behavior
(savehist-mode 1)
(setq make-backup-files nil) ; get rid of clutter~.
(setq auto-save-default nil) ; get rid of #clutter#.
(setq vc-follow-symlinks t) ; just edit the file.
;; Visual settings
(setq inhibit-splash-screen t) ; no splash screen, thanks
(menu-bar-mode 0) ; no menu bar
(tool-bar-mode 0) ; no tool bar
(scroll-bar-mode 0) ; no scroll bar
(line-number-mode 1) ; have line numbers and
(column-number-mode 1) ; column numbers in the mode line
;;(global-hl-line-mode) ; highlight current line
(global-visual-line-mode) ; without this, hl-line-mode and org-indent-mode
; conflict with each other. this should probably
; be enabled solely for org-mode via a hook.
(global-linum-mode 1) ; add line numbers on the left
(color-theme-charcoal-black)
;; (defadvice comment-region (before slick-comment activate compile)
;; "When called interactively with no active region, comment a single line instead."
;; (interactive
;; (if mark-active (list (region-beginning) (region-end))
;; (list (line-beginning-position) (line-beginning-position 2)))))
;; (defadvice uncomment-region (before slick-uncomment activate compile)
;; "When called interactively with no active region, uncomment a single line instead."
;; (interactive
;; (if mark-active (list (region-beginning) (region-end))
;; (list (line-beginning-position) (line-beginning-position 2)))))
;; ;; ;; evil-mode customizations
;; ;; (define-key evil-normal-state-map (kbd "C-6") 'evil-buffer)
;; ;; ;;; make esc quit everything.
;; ;; (define-key evil-normal-state-map [escape] 'keyboard-quit)
;; ;; (define-key evil-visual-state-map [escape] 'keyboard-quit)
;; ;; (define-key minibuffer-local-map [escape] 'abort-recursive-edit)
;; ;; (define-key minibuffer-local-ns-map [escape] 'abort-recursive-edit)
;; ;; (define-key minibuffer-local-completion-map [escape] 'abort-recursive-edit)
;; ;; (define-key minibuffer-local-must-match-map [escape] 'abort-recursive-edit)
;; ;; (define-key minibuffer-local-isearch-map [escape] 'abort-recursive-edit)
;; ;; ;; define a leader key for use in custom mappings.
;; ;; (let ((leader ","))
;; ;; (define-key evil-normal-state-map (concat leader "cc") 'comment-region)
;; ;; (define-key evil-visual-state-map (concat leader "cc") 'comment-region)
;; ;; (define-key evil-normal-state-map (concat leader "cu") 'uncomment-region)
;; ;; (define-key evil-visual-state-map (concat leader "cu") 'uncomment-region)
;; ;; )
;; ;; org-mode settings
;; (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
;; (setq org-startup-indented t)
;; (setq org-log-done 'time)
;; ;; (global-set-key "\C-cl" 'org-store-link)
;; ;; (global-set-key "\C-ca" 'org-agenda)
;; ;; (global-set-key "\C-cb" 'org-iswitchb)
;; ;; Remap org-mode meta keys for convenience
;; ;; These didn't work when I tried to combine them using mapc...
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-l") 'org-metaright)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-k") 'org-metaup)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-j") 'org-metadown)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-h") 'org-metaleft)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-L") 'org-shiftmetaright)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-K") 'org-shiftmetaup)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-J") 'org-shiftmetadown)
;; ;; (evil-define-key 'normal org-mode-map (kbd "M-H") 'org-shiftmetaleft)
;; ;; (evil-define-key 'insert org-mode-map (kbd "M-l") 'org-metaright)
;; ;; (evil-define-key 'insert org-mode-map (kbd "M-k") 'org-metaup)
;; ;; (evil-define-key 'insert org-mode-map (kbd "M-j") 'org-metadown)
;; ;; (let (org-log-done org-log-states) ; turn off logging
;; ;; (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
;; (setq org-publish-project-alist
;; '(
;; ("all-org"
;; :base-directory "~/org"
;; :base-extension "org"
;; :publishing-directory "~/org/html"
;; :recursive nil
;; :publishing-function org-publish-org-to-html
;; :headline-levels 4
;; :style-include-default nil
;; :style "<link rel=\"stylesheet\" type=\"text/css\" href=\"zeller.css\" />"
;; )
;; ("all-static"
;; :base-directory "~/org"
;; :base-extension "css\\|js\\|png\\|jpg"
;; :publishing-directory "~/org/html"
;; :recursive nil
;; :publishing-function org-publish-attachment
;; )
;; ("all" :components ("all-org" "all-static"))
;; ))
;; ;; org-babel settings
;; (org-babel-do-load-languages
;; 'org-babel-load-languages '(
;; (python . t)
;; (R . t)
;; (sh . t)
;; ))
(require 'org-latex)
(setq org-export-latex-classes
(cons '("article"
"\\documentclass{article}
\\usepackage{amsmath}
\\usepackage{amssymb}
\\usepackage{longtable}
\\usepackage{float}
\\usepackage{wrapfig}
\\usepackage{soul}
\\usepackage{hyperref}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
org-export-latex-classes))