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