]> git.donarmstrong.com Git - lib.git/blob - emacs_el/configuration/don-configuration.org
load org-mode configuration
[lib.git] / emacs_el / configuration / don-configuration.org
1 * Load debugger
2
3 # if for some reason, things get pear-shaped, we want to be able to
4 # enter the debugger by sending -USR2 to emacs
5
6 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
7 (setq debug-on-event 'siguser2)
8 #+END_SRC
9 * Add library paths
10
11 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
12   (add-to-list 'load-path '"~/lib/emacs_el/")
13   (add-to-list 'load-path '"~/lib/emacs_el/helm")
14   (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/lisp/tiny")
15   (add-to-list 'load-path '"~/lib/emacs_el/tiny-tools/lisp/other")
16   (add-to-list 'load-path '"~/lib/emacs_el/auctex/lisp")
17   (add-to-list 'load-path '"~/lib/emacs_el/auctex")
18   (add-to-list 'load-path '"~/lib/emacs_el/ESS/lisp")
19   (add-to-list 'load-path '"~/lib/emacs_el/org-mode/lisp")
20   (add-to-list 'load-path '"~/lib/emacs_el/auctex-beamer")
21   (add-to-list 'load-path '"~/lib/emacs_el/magit-annex")
22 #+END_SRC
23
24
25 * Misc functions
26 ** with-library
27 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
28 ;; From http://www.emacswiki.org/emacs/LoadingLispFiles
29 ;; execute conditional code when loading libraries
30 (defmacro with-library (symbol &rest body)
31   `(when (require ,symbol nil t)
32      ,@body))
33 (put 'with-library 'lisp-indent-function 1)
34 #+END_SRC
35
36
37
38 * Modules
39 ** Tinyprocmail
40
41 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
42   ;; load tinyprocmail
43   (with-library 'tinyprocmail
44     ; (setq tinyprocmail--procmail-version "v3.22")
45     (add-hook 'tinyprocmail--load-hook 'tinyprocmail-install))
46 #+END_SRC
47
48 ** Magit
49 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
50   ; don't verify where we are pushing
51   (setq magit-push-always-verify nil)
52 #+END_SRC
53
54 ** Perl
55 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
56   (require 'cperl-mode)
57   ;; Use c-mode for perl .xs files
58   (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
59   (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
60   (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
61   (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
62   (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
63   (setq cperl-hairy t
64         cperl-indent-level 4
65         cperl-auto-newline nil
66         cperl-auto-newline-after-colon nil
67         cperl-continued-statement-offset 4
68         cperl-brace-offset -1
69         cperl-continued-brace-offset 0
70         cperl-label-offset -4
71         cperl-highlight-variables-indiscriminately t
72         cperl-electric-lbrace-space nil
73         cperl-indent-parens-as-block nil
74         cperl-close-paren-offset -1
75         cperl-tab-always-indent t)
76   ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
77 #+END_SRC
78
79 ** Helm
80 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
81 (require 'don-helm)
82 #+END_SRC
83 ** Hydra
84 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
85 (require 'don-hydra)
86 #+END_SRC
87
88 ** Tramp
89 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
90   (add-to-list 'tramp-methods '("vcsh"
91                                 (tramp-login-program "vcsh")
92                                 (tramp-login-args
93                                  (("enter")
94                                   ("%h")))
95                                 (tramp-remote-shell "/bin/sh")
96                                 (tramp-remote-shell-args
97                                  ("-c"))))
98 #+END_SRC
99 ** LaTeX
100 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
101   (load "auctex.el" nil t t)
102   (load "preview-latex.el" nil t t)
103   (load "latex.el" nil t t)
104
105   ;; this is in the very newest auctex; avoid for now
106   (add-to-list 'LaTeX-fill-excluded-macros
107                '("Sexpr"))
108   ;; REFTEX (much enhanced management of cross-ref, labels, etc)
109   ;; http://www.strw.leidenuniv.nl/~dominik/Tools/reftex/
110   (autoload 'reftex-mode     "reftex" "RefTeX Minor Mode" t)
111   (autoload 'turn-on-reftex  "reftex" "RefTeX Minor Mode" nil)
112   (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
113   (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase mode" t)
114   (add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX mode
115   (add-hook 'latex-mode-hook 'turn-on-reftex)   ; with Emacs latex mode
116   (add-hook 'LaTeX-mode-hook 'outline-minor-mode)   ; with AUCTeX LaTeX mode
117   (add-hook 'latex-mode-hook 'outline-minor-mode)   ; with Emacs latex mode
118
119   ; use smart quotes by default instead of `` and ''
120   ; taken from http://kieranhealy.org/esk/kjhealy.html
121   (setq TeX-open-quote "“")
122   (setq TeX-close-quote "”")
123
124   ;; (TeX-add-style-hook
125   ;;  "latex"
126   ;;  (lambda ()
127   ;;    (TeX-add-symbols
128   ;;     '("DLA" 1))))
129   ;; (custom-set-variables
130   ;;  '(font-latex-user-keyword-classes 
131   ;;    '(("fixme" 
132   ;;       ("DLA" "RZ")
133   ;;       font-lock-function-name-face 2 (command 1 t))))
134   ;; ) 
135
136   (require 'font-latex)
137   (setq font-latex-match-reference-keywords
138         '(
139           ("fref" "{")
140           ("Fref" "{")
141           ("citep" "{")
142           ("citet" "{")
143           ("acs" "{")
144           ("acsp" "{")
145           ("ac" "{")
146           ("acp" "{")
147           ("acl" "{")
148           ("aclp" "{")
149           ("acsu" "{")
150           ("aclu" "{")
151           ("acused" "{")
152   ;         ))
153   ; (setq font-latex-match-warning-keywords
154   ;       '(
155           ("DLA" "{")
156           ("RZ" "{")
157           ("OM" "{")
158           ("DL" "{")
159           ("fixme" "{")))
160         
161   (setq-default TeX-parse-self t)
162   (setq-default TeX-auto-save t)
163   (setq-default TeX-master nil)
164
165   ;; this doesn't seem to work; not currently sure why
166   ; (setq font-latex-user-keyword-classes
167   ;       '(("my-warning-commands"
168   ;          (("DLA" "{")
169   ;           ("RZ" "{")
170   ;           ("OM" "{")
171   ;           ("DL" "{")
172   ;           ("fixme" "{")
173   ;           )
174   ;          (:foreground "red" :weight bold :underline (:color foreground-color :style line)))
175   ;         ))
176
177   (setq-default reftex-default-bibliography
178         '("~/projects/research/references.bib"))
179
180
181 #+END_SRC
182 ** Org
183 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
184   (require 'org-mode-configuration)
185 #+END_SRC
186
187 * Keybindings
188 ** Override other things
189 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
190   ; apparently things like to step on C-;, so we'll use a hack from
191   ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
192
193   (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
194
195   ; use iedit everywhere
196   (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
197   ;; use outline mode keybindings everywhere
198   (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
199
200   (define-minor-mode my-keys-minor-mode
201     "A minor mode so that my key settings override annoying major modes."
202     t " my-keys" 'my-keys-minor-mode-map)
203
204   (my-keys-minor-mode 1)
205   (defun my-minibuffer-setup-hook ()
206     (my-keys-minor-mode 0))
207
208   (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
209   (defadvice load (after give-my-keybindings-priority)
210     "Try to ensure that my keybindings always have priority."
211     (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
212         (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
213           (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
214           (add-to-list 'minor-mode-map-alist mykeys))))
215   (ad-activate 'load)
216 #+END_SRC
217
218 * END
219 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
220   (provide 'don-configuration)
221 #+END_SRC