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