]> git.donarmstrong.com Git - lib.git/blob - emacs_el/configuration/don-configuration.org
don't verify when pushing using magit
[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 ** Magit
43 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
44   ; don't verify where we are pushing
45   (setq magit-push-always-verify nil)
46 #+END_SRC
47
48 ** Perl
49 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
50   (require 'cperl-mode)
51   ;; Use c-mode for perl .xs files
52   (add-to-list 'auto-mode-alist '("\\.xs\\'" . c-mode))
53   (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
54   (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
55   (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
56   (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
57   (setq cperl-hairy t
58         cperl-indent-level 4
59         cperl-auto-newline nil
60         cperl-auto-newline-after-colon nil
61         cperl-continued-statement-offset 4
62         cperl-brace-offset -1
63         cperl-continued-brace-offset 0
64         cperl-label-offset -4
65         cperl-highlight-variables-indiscriminately t
66         cperl-electric-lbrace-space nil
67         cperl-indent-parens-as-block nil
68         cperl-close-paren-offset -1
69         cperl-tab-always-indent t)
70   ;(add-hook 'cperl-mode-hook (lambda () (cperl-set-style "PerlStyle")))
71 #+END_SRC
72
73 ** Helm
74 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
75 (require 'don-helm)
76 #+END_SRC
77 ** Hydra
78 #+BEGIN_SRC emacs-lisp :tangle don-configuration.el
79 (require 'don-hydra)
80 #+END_SRC
81
82 ** Tramp
83 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
84   (add-to-list 'tramp-methods '("vcsh"
85                                 (tramp-login-program "vcsh")
86                                 (tramp-login-args
87                                  (("enter")
88                                   ("%h")))
89                                 (tramp-remote-shell "/bin/sh")
90                                 (tramp-remote-shell-args
91                                  ("-c"))))
92 #+END_SRC
93 * Keybindings
94 ** Override other things
95 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
96   ; apparently things like to step on C-;, so we'll use a hack from
97   ; http://stackoverflow.com/questions/683425/globally-override-key-binding-in-emacs/5340797#5340797 to fix this
98
99   (defvar my-keys-minor-mode-map (make-keymap) "my-keys-minor-mode keymap.")
100
101   ; use iedit everywhere
102   (define-key my-keys-minor-mode-map (kbd "C-;") 'iedit-mode)
103   ;; use outline mode keybindings everywhere
104   (define-key my-keys-minor-mode-map (kbd "C-;") 'my/mydra-outline/body)
105
106   (define-minor-mode my-keys-minor-mode
107     "A minor mode so that my key settings override annoying major modes."
108     t " my-keys" 'my-keys-minor-mode-map)
109
110   (my-keys-minor-mode 1)
111   (defun my-minibuffer-setup-hook ()
112     (my-keys-minor-mode 0))
113
114   (add-hook 'minibuffer-setup-hook 'my-minibuffer-setup-hook)
115   (defadvice load (after give-my-keybindings-priority)
116     "Try to ensure that my keybindings always have priority."
117     (if (not (eq (car (car minor-mode-map-alist)) 'my-keys-minor-mode))
118         (let ((mykeys (assq 'my-keys-minor-mode minor-mode-map-alist)))
119           (assq-delete-all 'my-keys-minor-mode minor-mode-map-alist)
120           (add-to-list 'minor-mode-map-alist mykeys))))
121   (ad-activate 'load)
122 #+END_SRC
123
124 * END
125 #+BEGIN_SRC emacs-lisp  :tangle don-configuration.el
126   (provide 'don-configuration)
127 #+END_SRC