]> git.donarmstrong.com Git - lib.git/blob - emacs_el/configuration/don-configuration.org
update org files
[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 #+END_SRC
17
18
19 * Misc functions
20 ** with-library
21 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
22 ;; From http://www.emacswiki.org/emacs/LoadingLispFiles
23 ;; execute conditional code when loading libraries
24 (defmacro with-library (symbol &rest body)
25   `(when (require ,symbol nil t)
26      ,@body))
27 (put 'with-library 'lisp-indent-function 1)
28 #+END_SRC
29
30
31
32 * Modules
33 ** Tinyprocmail
34
35 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
36   ;; load tinyprocmail
37   (with-library 'tinyprocmail
38     ; (setq tinyprocmail--procmail-version "v3.22")
39     (add-hook 'tinyprocmail--load-hook 'tinyprocmail-install))
40 #+END_SRC
41
42 ** Perl
43 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
44   (require 'cperl-mode)
45   ;; Use c-mode for perl .xs files
46   (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
47   (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
48   (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
49   (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
50   (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
51   (setq cperl-hairy t
52         cperl-indent-level 4
53         cperl-auto-newline nil
54         cperl-auto-newline-after-colon nil
55         cperl-continued-statement-offset 4
56         cperl-brace-offset -1
57         cperl-continued-brace-offset 0
58         cperl-label-offset -4
59         cperl-highlight-variables-indiscriminately t
60         cperl-electric-lbrace-space nil
61         cperl-indent-parens-as-block nil
62         cperl-close-paren-offset -1
63         cperl-tab-always-indent t)
64   ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
65 #+END_SRC
66
67 ** Helm
68 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
69 (require 'don-helm)
70 #+END_SRC
71 ** Hydra
72 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
73 (require 'don-hydra)
74 #+END_SRC
75
76 ** Tramp
77 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
78   (add-to-list 'tramp-methods '("vcsh"
79                                 (tramp-login-program "vcsh")
80                                 (tramp-login-args
81                                  (("enter")
82                                   ("%h")))
83                                 (tramp-remote-shell "/bin/sh")
84                                 (tramp-remote-shell-args
85                                  ("-c"))))
86 #+END_SRC
87 * Keybindings
88 ** Override other things
89 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
90   ; apparently things like to step on C-;, so we'll use a hack from
91   ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
92
93   (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
94
95   ; use iedit everywhere
96   (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
97   ;; use outline mode keybindings everywhere
98   (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
99
100   (define-minor-mode my-keys-minor-mode
101     "A minor mode so that my key settings override annoying major modes."
102     t " my-keys" 'my-keys-minor-mode-map)
103
104   (my-keys-minor-mode 1)
105   (defun my-minibuffer-setup-hook ()
106     (my-keys-minor-mode 0))
107
108   (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
109   (defadvice load (after give-my-keybindings-priority)
110     "Try to ensure that my keybindings always have priority."
111     (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
112         (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
113           (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
114           (add-to-list 'minor-mode-map-alist mykeys))))
115   (ad-activate 'load)
116 #+END_SRC
117
118 * END
119 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
120   (provide 'don-configuration)
121 #+END_SRC