annotate .emacs @ 297:618db1b1f34b

dmenu + emacs, baby
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 11 May 2013 10:00:48 -0700
parents c738405d0d6c
children cc2f7d8307d0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
280
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
1 ;; emacs server (what a piece of crap)
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
2 ;; (commented out for now)
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
3 ;; (require 'server)
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
4 ;; (or (server-running-p)
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
5 ;; (server-start))
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
6
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
7 ;;;; bars
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
8
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
9 ;; Turn off the status bar and on the mouse if we're not in a window system
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
10 (menu-bar-mode (if window-system 1 -1))
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
11
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
12 ;; no need for a tool bar
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
13 (if (boundp 'tool-bar-mode) (tool-bar-mode 0))
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
14
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
15 ;; ...or a startup message
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
16 (setq inhibit-startup-message t)
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
17
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
18 ;; no f-ing backup files
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
19 (setq make-backup-files nil)
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
20
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
21 ;; show trailing whitespace
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
22 (setq-default show-trailing-whitespace t)
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
23
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
24 ;;;;
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
25
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
26 (put 'downcase-region 'disabled nil)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
27 (setq truncate-lines nil)
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
28 (setq truncate-partial-width-windows nil)
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
29 (setq use-file-dialog nil)
75
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
30
280
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
31 ;; make directories when they don't exist
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
32 ;; from http://stackoverflow.com/questions/6830671/how-to-make-emacs-create-intermediate-dirs-when-saving-a-file
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
33 (add-hook 'before-save-hook
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
34 (lambda ()
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
35 (when buffer-file-name
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
36 (let ((dir (file-name-directory buffer-file-name)))
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
37 (when (not (file-exists-p dir))
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
38 (make-directory dir t))))))
c738405d0d6c mkdir -p
Jeff Hammel <jhammel@mozilla.com>
parents: 275
diff changeset
39
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
40 ;;;; indentation
75
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
41
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
42 ;; python indentation
120
339805e00f03 set python spacing back to four, by popular demand
Jeff Hammel <jhammel@mozilla.com>
parents: 75
diff changeset
43 (setq python-indent 4)
339805e00f03 set python spacing back to four, by popular demand
Jeff Hammel <jhammel@mozilla.com>
parents: 75
diff changeset
44 (setq-default py-indent-offset 4)
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
45 (setq python-guess-indent nil)
75
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
46
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
47 ;; javascript indentation: http://www.brgeight.se/downloads/emacs/javascript.el
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
48 (setq javascript-indent-level 2)
148
7a4c86310463 add another variable
Jeff Hammel <jhammel@mozilla.com>
parents: 120
diff changeset
49 (setq js-indent-level 2)
75
89a64b0d6146 adding indentation for javascript
Jeff Hammel <jhammel@mozilla.com>
parents: 62
diff changeset
50
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
51 (setq-default indent-tabs-mode nil)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
52 (defface extra-whitespace-face '((t (:background "pale green"))) "Used for tabs and such.")
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
53
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
54 (autoload 'doctest-mode "doctest-mode" "doctest editing mode." t)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
55
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
56 (transient-mark-mode 1)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
57
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
58 (put 'upcase-region 'disabled nil)
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
59
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
60 ;;;; line/col #s
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
61
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
62 ;; Show line-number in the mode line
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
63 (line-number-mode 1)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
64
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
65 ;; Show column-number in the mode line
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
66 (column-number-mode 1)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
67
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
68 ;;;; modes
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
69
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
70 ;; Bind major editing modes to certain file extensions
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
71 (setq auto-mode-alist (cons '("\\.zcml$" . sgml-mode) auto-mode-alist))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
72 (setq auto-mode-alist (cons '("\\.pt$" . sgml-mode) auto-mode-alist))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
73 (setq auto-mode-alist (cons '("\\.cpt$" . sgml-mode) auto-mode-alist))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
74 (setq auto-mode-alist (cons '("\\.cpy$" . python-mode) auto-mode-alist))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
75 (setq auto-mode-alist (cons '("\\.vpy$" . python-mode) auto-mode-alist))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
76
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
77 ;; set auto-fill for modes
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
78 (add-hook 'text-mode-hook 'turn-on-auto-fill)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
79 (add-hook 'sgml-mode-hook 'turn-off-auto-fill)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
80
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
81 (setq grep-command "grep -liE")
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
82
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
83 ;; recent history stuff
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
84 (require 'recentf)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
85 (recentf-mode 1)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
86 (setq recentf-max-menu-items 25)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
87 (global-set-key "\C-x\ \C-r" 'recentf-open-files)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
88
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
89 ;; full-steam-ahead-and-damn-the-torpedoes
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
90 (defun
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
91 full-steam-ahead-and-damn-the-torpedoes
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
92 (prompt) t)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
93 (defalias 'y-or-n-p
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
94 'full-steam-ahead-and-damn-the-torpedoes)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
95 (defalias 'yes-or-no-p
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
96 'full-steam-ahead-and-damn-the-torpedoes)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
97
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
98 (require 'uniquify)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
99 (setq uniquify-buffer-name-style 'post-forward)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
100
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
101 ;; wheel mouse
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
102 (global-set-key [mouse-4] 'scroll-down)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
103 (global-set-key [mouse-5] 'scroll-up)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
104
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
105 ;; substring buffer switching mode
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
106 (iswitchb-mode 1)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
107
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
108 (global-set-key "\M-g" 'goto-line)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
109
297
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
110 ;;;; python
618db1b1f34b dmenu + emacs, baby
Jeff Hammel <jhammel@mozilla.com>
parents: 280
diff changeset
111
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
112 ;; (when (load "flymake" t)
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
113 ;; (defun flymake-pyflakes-init ()
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
114 ;; (let* ((temp-file (flymake-init-create-temp-buffer-copy
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
115 ;; 'flymake-create-temp-inplace))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
116 ;; (local-file (file-relative-name
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
117 ;; temp-file
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
118 ;; (file-name-directory buffer-file-name))))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
119 ;; (list "pyflakes" (list local-file))))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
120 ;; (add-to-list 'flymake-allowed-file-name-masks
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
121 ;; '("\\.py\\'" flymake-pyflakes-init)))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
122
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
123 ;; (add-hook 'find-file-hook 'flymake-find-file-hook)
4
81e89e519980 changed a bunch of stuff, evidently
k0s <k0scist@gmail.com>
parents: 0
diff changeset
124
81e89e519980 changed a bunch of stuff, evidently
k0s <k0scist@gmail.com>
parents: 0
diff changeset
125 (fset 'break "import pdb; pdb.set_trace();\C-a\C-i")
81e89e519980 changed a bunch of stuff, evidently
k0s <k0scist@gmail.com>
parents: 0
diff changeset
126 (add-hook 'python-mode-hook
81e89e519980 changed a bunch of stuff, evidently
k0s <k0scist@gmail.com>
parents: 0
diff changeset
127 '(lambda ()
81e89e519980 changed a bunch of stuff, evidently
k0s <k0scist@gmail.com>
parents: 0
diff changeset
128 (local-set-key [(meta ?p) (meta ?p)] 'break)))