Mercurial > dotfiles
annotate .emacs @ 11:9b9098bda691
Basic git config for when I need it.
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Tue, 02 Dec 2008 19:54:25 -0600 |
| parents | 6b651c7265f2 |
| children | d4d720c4c416 |
| 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 | |
| 13 (require 'show-wspace) | |
| 14 (require 'doctest-mode) | |
| 15 | |
|
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
|
16 ; 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
|
17 (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
|
18 (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
|
19 |
| 0 | 20 ; Start the server so that emacsclient will work |
| 21 ; TODO: is there a way to *not* start a server if one was already running? | |
| 22 (server-start) | |
| 23 | |
| 24 ; All lines should end in a newline | |
| 25 (setq require-final-newline t) | |
| 26 | |
| 27 ; disable tabs | |
| 28 (setq tab-width 4) | |
| 29 (setq-default indent-tabs-mode nil) | |
| 30 | |
|
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
|
31 ; 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
|
32 (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
|
33 "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
|
34 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
|
35 (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
|
36 (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
|
37 (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
|
38 (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
|
39 (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
|
40 (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
|
41 |
|
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 (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
|
43 (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
|
44 |
|
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 ;; 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
|
46 (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
|
47 (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
|
48 (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
|
49 (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
|
50 |
| 0 | 51 (defun af-python-mode-hook () |
| 52 ; highlight tabs in Python | |
| 53 (make-variable-buffer-local 'font-lock-mode-hook) | |
| 54 (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs) | |
| 55 (make-variable-buffer-local 'python-indent) | |
| 56 (if (string-match "melange" buffer-file-name) | |
| 57 (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
|
58 (af-tab-fix) |
| 0 | 59 ) |
| 60 (add-hook 'python-mode-hook 'af-python-mode-hook) | |
| 61 | |
| 62 ;;pymacs | |
| 63 (setenv "PYTHONPATH" (concat (getenv "HOME") "/unixSoft/lib/python")) | |
| 64 (autoload 'pymacs-apply "pymacs") | |
| 65 (autoload 'pymacs-call "pymacs") | |
| 66 (autoload 'pymacs-eval "pymacs" nil t) | |
| 67 (autoload 'pymacs-exec "pymacs" nil t) | |
| 68 (autoload 'pymacs-load "pymacs" nil t) | |
| 69 (eval-after-load "pymacs" | |
| 70 '(add-to-list 'pymacs-load-path "~/unixSoft/lib/python")) | |
| 71 ;(pymacs-load "ropemacs" "rope-") | |
| 72 ;(setq ropemacs-enable-autoimport t) | |
| 73 | |
| 74 ; text-mode tries to use M-s for something other than my save shortcut. | |
| 75 ; That's evil. Stop it from doing that. | |
| 76 (add-hook 'text-mode-hook '(lambda () | |
| 77 (define-key text-mode-map "\M-s" | |
| 78 'save-buffer))) | |
| 79 | |
| 80 ; Cleanup whitespace before saves. | |
| 81 (add-hook 'before-save-hook '(lambda () | |
| 82 (whitespace-cleanup))) | |
| 83 | |
| 84 ; Disable that startup screen | |
| 85 (setq inhibit-startup-message t) | |
| 86 | |
| 87 ; Basically everything I do is in version control, stop saving backup files | |
| 88 (setq make-backup-files nil) | |
| 89 | |
| 90 ; Set some pretty colors that are gentler on my eyes | |
| 91 (setq default-frame-alist | |
| 92 '((width . 80) | |
| 93 (cursor-color . "white") | |
| 94 (cursor-type . box) | |
| 95 (foreground-color . "white") | |
| 96 (background-color . "black") | |
| 97 ) | |
| 98 ) | |
|
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
|
99 ; 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
|
100 (show-paren-mode 1) |
| 0 | 101 |
| 102 ;; Desktop mode to remember buffers | |
| 103 (load "desktop") | |
| 104 (setq desktop-enable t) | |
| 105 | |
| 106 ;; Automatically revert unedited files that change on the underlying | |
| 107 ;; system. | |
| 108 (global-auto-revert-mode) | |
| 109 | |
| 110 ;; Key Bindings | |
| 111 ; M-backspace kills the current buffer | |
| 112 (global-set-key [(meta backspace)] 'kill-this-buffer) | |
| 113 ; Save early and often, with only one keystroke | |
| 114 (global-set-key [(meta s)] 'save-buffer) | |
| 115 ; Typing tab is for lesser editors, make hitting return do that | |
| 116 (global-set-key "\C-m" 'newline-and-indent) |
