view .emacs @ 3:1921c0b85a82

Handy keybindings.
author Augie Fackler <durin42@gmail.com>
date Wed, 26 Nov 2008 18:47:20 -0600
parents c30d68fbd368
children 9541f7e47514
line wrap: on
line source

;; Augie Fackler's .emacs file
; Places I've stolen from:
;  Karl Fogel: http://svn.red-bean.com/repos/kfogel/trunk
;  Dave Anderson:

(setq load-path (cons (expand-file-name "~/.elisp") load-path))
; Better buffer switching and file loading (load first in case we need the
; * Messages * buffer)
(require 'ido)
(ido-mode t)

(require 'show-wspace)
(require 'doctest-mode)

; Start the server so that emacsclient will work
; TODO: is there a way to *not* start a server if one was already running?
(server-start)

; All lines should end in a newline
(setq require-final-newline t)

; disable tabs
(setq tab-width 4)
(setq-default indent-tabs-mode nil)

(defun af-python-mode-hook ()
  ; highlight tabs in Python
  (make-variable-buffer-local 'font-lock-mode-hook)
  (add-hook 'font-lock-mode-hook 'show-ws-highlight-tabs)
  (make-variable-buffer-local 'python-indent)
  (if (string-match "melange" buffer-file-name)
      (set-variable 'python-indent 2))
)
(add-hook 'python-mode-hook 'af-python-mode-hook)

;;pymacs
(setenv "PYTHONPATH" (concat (getenv "HOME") "/unixSoft/lib/python"))
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(eval-after-load "pymacs"
  '(add-to-list 'pymacs-load-path "~/unixSoft/lib/python"))
;(pymacs-load "ropemacs" "rope-")
;(setq ropemacs-enable-autoimport t)

; text-mode tries to use M-s for something other than my save shortcut.
; That's evil. Stop it from doing that.
(add-hook 'text-mode-hook '(lambda ()
			     (define-key text-mode-map "\M-s"
			       'save-buffer)))

; Cleanup whitespace before saves.
(add-hook 'before-save-hook '(lambda ()
			       (whitespace-cleanup)))

; Disable that startup screen
(setq inhibit-startup-message t)

; Basically everything I do is in version control, stop saving backup files
(setq make-backup-files nil)

; Set some pretty colors that are gentler on my eyes
(setq default-frame-alist
      '((width . 80)
	(cursor-color . "white")
	(cursor-type . box)
	(foreground-color . "white")
	(background-color . "black")
	)
      )

;; Desktop mode to remember buffers
(load "desktop")
(setq desktop-enable t)

;; Automatically revert unedited files that change on the underlying
;; system.
(global-auto-revert-mode)

;; Key Bindings
; M-backspace kills the current buffer
(global-set-key [(meta backspace)] 'kill-this-buffer)
; Save early and often, with only one keystroke
(global-set-key [(meta s)] 'save-buffer)
; Typing tab is for lesser editors, make hitting return do that
(global-set-key "\C-m" 'newline-and-indent)