Mercurial > dotfiles
annotate .emacs @ 22:8715ccb6f61b
Start using textmate.el.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 12 Dec 2008 09:38:16 -0600 |
parents | b5d75594b356 |
children | 614a83a1c5dd |
rev | line source |
---|---|
0 | 1 ;; Augie Fackler's .emacs file |
2 ; Places I've stolen from: | |
3 ; Karl Fogel: http://svn.red-bean.com/repos/kfogel/trunk | |
4 ; Dave Anderson: | |
5 | |
6 (setq load-path (cons (expand-file-name "~/.elisp") load-path)) | |
7 ; Better buffer switching and file loading (load first in case we need the | |
8 ; * Messages * buffer) | |
9 (require 'ido) | |
8
6b651c7265f2
Flex matching for ido-mode.
Augie Fackler <durin42@gmail.com>
parents:
7
diff
changeset
|
10 (setq ido-enable-flex-matching t) |
0 | 11 (ido-mode t) |
12 | |
19
b5d75594b356
Add support for the ipython-mode stuff and remove vestigial pymacs code.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
13 (require 'python-mode) |
b5d75594b356
Add support for the ipython-mode stuff and remove vestigial pymacs code.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
14 (require 'ipython) |
b5d75594b356
Add support for the ipython-mode stuff and remove vestigial pymacs code.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
15 |
0 | 16 (require 'show-wspace) |
17 | |
12
d4d720c4c416
Add mercurial support to emacs. Improve setting of PYTHONPATH in there.
Augie Fackler <durin42@gmail.com>
parents:
8
diff
changeset
|
18 (require 'mercurial) |
d4d720c4c416
Add mercurial support to emacs. Improve setting of PYTHONPATH in there.
Augie Fackler <durin42@gmail.com>
parents:
8
diff
changeset
|
19 |
7
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
20 ; Clojure |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
21 (require 'clojure-auto) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
22 (setq auto-mode-alist (cons '("\\.clj$" . clojure-mode) auto-mode-alist)) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
23 |
22 | 24 (require 'textmate) |
25 (textmate-mode) | |
26 (textmate-also-ignore "eggs|cover|daisy|.*.pyc") | |
27 | |
0 | 28 ; Start the server so that emacsclient will work |
29 ; TODO: is there a way to *not* start a server if one was already running? | |
30 (server-start) | |
31 | |
32 ; All lines should end in a newline | |
33 (setq require-final-newline t) | |
34 | |
35 ; disable tabs | |
36 (setq tab-width 4) | |
37 (setq-default indent-tabs-mode nil) | |
38 | |
7
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
39 ; use tab for indent or complete |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
40 (defun indent-or-expand (arg) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
41 "Either indent according to mode, or expand the word preceding |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
42 point." |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
43 (interactive "*P") |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
44 (if (and |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
45 (or (bobp) (= ?w (char-syntax (char-before)))) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
46 (or (eobp) (not (= ?w (char-syntax (char-after)))))) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
47 (dabbrev-expand arg) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
48 (indent-according-to-mode))) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
49 |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
50 (defun af-tab-fix () |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
51 (local-set-key [tab] 'indent-or-expand)) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
52 |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
53 ;; add hooks for modes you want to use the tab completion for: |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
54 (add-hook 'c-mode-hook 'af-tab-fix) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
55 (add-hook 'sh-mode-hook 'af-tab-fix) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
56 (add-hook 'emacs-lisp-mode-hook 'af-tab-fix) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
57 (add-hook 'clojure-mode-hook 'af-tab-fix) |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
58 |
0 | 59 (defun af-python-mode-hook () |
60 ; highlight tabs in Python | |
61 (make-variable-buffer-local 'font-lock-mode-hook) | |
62 (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs) | |
63 (make-variable-buffer-local 'python-indent) | |
19
b5d75594b356
Add support for the ipython-mode stuff and remove vestigial pymacs code.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
64 (if (and buffer-file-name (string-match "melange" buffer-file-name)) |
b5d75594b356
Add support for the ipython-mode stuff and remove vestigial pymacs code.
Augie Fackler <durin42@gmail.com>
parents:
14
diff
changeset
|
65 (set-variable 'python-indent 2)) |
7
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
66 (af-tab-fix) |
0 | 67 ) |
68 (add-hook 'python-mode-hook 'af-python-mode-hook) | |
69 | |
70 | |
71 ; text-mode tries to use M-s for something other than my save shortcut. | |
72 ; That's evil. Stop it from doing that. | |
73 (add-hook 'text-mode-hook '(lambda () | |
74 (define-key text-mode-map "\M-s" | |
75 'save-buffer))) | |
76 | |
77 ; Cleanup whitespace before saves. | |
78 (add-hook 'before-save-hook '(lambda () | |
79 (whitespace-cleanup))) | |
80 | |
81 ; Disable that startup screen | |
82 (setq inhibit-startup-message t) | |
83 | |
84 ; Basically everything I do is in version control, stop saving backup files | |
85 (setq make-backup-files nil) | |
86 | |
87 ; Set some pretty colors that are gentler on my eyes | |
88 (setq default-frame-alist | |
89 '((width . 80) | |
90 (cursor-color . "white") | |
91 (cursor-type . box) | |
92 (foreground-color . "white") | |
93 (background-color . "black") | |
94 ) | |
95 ) | |
7
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
96 ; always highlight matching paren |
9541f7e47514
Some edits to .emacs after my playing with Clojure, also added Clojure support files.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
97 (show-paren-mode 1) |
0 | 98 |
99 ;; Automatically revert unedited files that change on the underlying | |
100 ;; system. | |
101 (global-auto-revert-mode) | |
102 | |
103 ;; Key Bindings | |
104 ; M-backspace kills the current buffer | |
105 (global-set-key [(meta backspace)] 'kill-this-buffer) | |
106 ; Save early and often, with only one keystroke | |
107 (global-set-key [(meta s)] 'save-buffer) | |
108 ; Typing tab is for lesser editors, make hitting return do that | |
109 (global-set-key "\C-m" 'newline-and-indent) | |
22 | 110 ; M-l makes more sense to me for jumping to a line |
111 (global-set-key "\M-l" 'goto-line) | |
14
34fd1e79495b
Fix for backspace being broken in some terminal emulators.
Augie Fackler <durin42@gmail.com>
parents:
12
diff
changeset
|
112 ; Sometimes C-h is what Backspace sends in a terminal, and I never use C-h |
34fd1e79495b
Fix for backspace being broken in some terminal emulators.
Augie Fackler <durin42@gmail.com>
parents:
12
diff
changeset
|
113 (global-set-key "\C-h" 'backward-delete-char-untabify) |
22 | 114 ; M-t is what I want for the textmate file finding |
115 (global-set-key [(meta t)] 'textmate-goto-file) |