Emacs Dot Old File

Emacs Config

Here's .emacs config file:

;; Emacs Init File ------------------------------
;; 2009-09-03
;;

;; Eliminate delay for set-default-font
;; --------------------------------------
;;
(modify-frame-parameters nil '((wait-for-wm . nil)))

;; http://steve.yegge.googlepages.com/effective-emacs
;; 10 Ways to Improve Productivity With Emacs
;; ------------------------------------------
;;

;; Item 1: Swap Caps-Lock and Control
;;
;; !
;; ! Swap Caps_Lock and Control_F
;; !
;; remove Lock = Caps_Lock
;; remove Control = Control_L
;; keysym Control_L = Caps_Lock
;; keysym Caps_Lock = Control_L
;; add Lock = Caps_Lock
;; add Control = Control_L


;; Item 2: Invoke M-x without the Alt key
;;
;; To enable Ctrl-x Ctrl-m sequence add following to .emacs

;; (global-set-key "\C-x\C-m" 'execute-extended-command)
;; (global-set-key "\C-c\C-m" 'execute-extended-command)


;; Item 3: Prefer backward-kill-word over Backspace
;; ------------------------------------------------
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
(global-set-key "\C-c\C-k" 'kill-region)

;; Item 4: Use incremental search for Navigation
;; ---------------------------------------------
;; Ctrl-s Forward search
;; Ctrl-r Backward search


;; Item 5: Use Temp Buffers
;; ------------------------
;; Ctrl-b
;; Name them anything like asdlkj
;; Save them with Ctrl-x Ctrl-w
;; You'll be asked for a filename


;; Item 6: Master the buffer and window commands
;; ---------------------------------------------
;; Important commands to master are:
;;
;; Ctrl-x 2 split-window-vertically
;; Ctrl-x 3 split-window-horizontally
;; Ctrl-x + balance windows
;; Ctrl-x o other-window
;; Ctrl-x 1 delete-other-windows
;; Ctrl-x 0 delete-this-windows
;; Ctrl-x Ctrl-b list-buffers

;; Item 7: Lose the UI
;; -------------------
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))

;; Item 8: Learn the most important help functions
;; -----------------------------------------------
;; M-x describe-bindings
;; M-x apropos-command 'some word'


;; Item 9: Master Emacs's regular
;; ------------------------------
;; Learn Regular Expressions


;; Item 10: Master fine-grained text manipulation

;; Set Ctrl-h as backward delete
;; -----------------------------
;; Taken from www.math.rutgers.edu/~komlos/emacs.htm
;;

;; Translate C-h to DEL
(keyboard-translate ?\C-h ?\C-?)
;; Define M-h to help --- please don't add an extra ' after help!
(global-set-key "\M-h" 'help)



;; Taken from http://geosoft.no/development/emacs.html
;;
; Disable startup message
(setq inhibit-startup-message t)

; Disable file backup
(setq make-backup-files nil)

; Disable file saves
(setq auto-save-list-file-name nil)

; Disable auto-save
(setq auto-save-default nil)

; Enable search highlight
(setq search-highlight t)


; Enable replace highlight
(setq query-replace-highlight t)

; Enable mouse highlight
(setq mouse-sel-retain-highlight t)

; Set region background color
(set-face-background 'region "orangered")

; Set region foreground color
(set-face-foreground 'region "white")

; Set background color
(set-background-color "white")




; Set default font to Misc 9x15
(set-default-font "-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1")

; Experiment with fonts
; I copied this from somewhere.
; The fonts look okay but they are not anti-aliased.
;
; Font preference
;(add-to-list 'default-frame-alist
;'(font . "-bitstream-bitstream vera sans mono-medium-r-normal-*-14-*-100-100-*-*-iso8859-*"))


; Following taken from:
; http://homepages.inf.ed.ac.uk/s0243221/emacs/

; Disable scroll jump
(setq scroll-step 1)

; Enable line number in mode line
(line-number-mode 1)

; Enable column number in mode line
(column-number-mode 1)

; Set cursor color to blue
(set-cursor-color "blue")

; Disable blinking cursor
(blink-cursor-mode nil)

; Disable beep. Flash on error
(setq-default visible-bell t)

; Highlight selected text - Ctrl-Space
(transient-mark-mode t)

; Spaces instead tabs
(setq-default indent-tabs-mode nil)

; Delete selected/highlighted text
(delete-selection-mode t)

; Re-Map M-<> to Ctrl-x e
(global-set-key (kbd "C-x e") 'end-of-buffer)

; Enable highlight bracket pairs
(show-paren-mode t)