This will be all kinds of ungodly and horrible if you don't have folding-mode installed. Prefers Aquamacs on OS X, but not having it breaks nothing.
;; File: ~/.emacs
;; Author: Burke Libbey <b.libbey@gmail.com>
;; Modified: $Date: 2008/01/23 12:18:24 $
(setq debug-on-error t)
(setq emacs-load-start-time (current-time))
(defconst aquamacs
(boundp 'aquamacs-version)
"Are we running Aquamacs on OS X?")
(add-to-list 'load-path "~/.emacs.d/lisp")
(custom-set-variables
'(global-font-lock-mode t nil (font-lock)) ;; Syntax higlighting
;; buffers with duplicate names will be dir/file, not file<n>
'(uniquify-buffer-name-style (quote forward) nil (uniquify))
'(minibuffer-max-depth nil) ;; enable multiple minibuffers:
'(indent-tabs-mode t) ;; hard tabs
'(default-tab-width 2) ;; tabs of width 2
'(scroll-bar-mode nil) ;; no scroll bar
'(tool-bar-mode nil) ;; highlight matches in query-replace
'(show-paren-mode t) ;; match parens
'(case-fold-search t) ;; case-insensitive search
'(transient-mark-mode t) ;; highlight the marked region
'(inhibit-startup-message t) ;; no startup message
'(default-major-mode 'text-mode) ;; open unknown in text mode
'(ring-bell-function 'ignore) ;; turn off system beep
'(c-default-style "k&r") ;; why is this even an option?
;;{{{ Color theme: OH, THE HUGE MANATEE!
(when aquamacs
'(aquamacs-additional-fontsets nil t)
'(aquamacs-customization-version-id 100 t)
'(aquamacs-default-styles
(quote
((default
(color-theme
color-theme-snapshot
((background-color . "Black")
(background-mode . dark)
(border-color . "black")
(cua-global-mark-cursor-color . "cyan")
(cua-normal-cursor-color . "red")
(cua-overwrite-cursor-color . "yellow")
(cua-read-only-cursor-color . "darkgreen")
(cursor-color . "Red")
(foreground-color . "SteelBlue")
(mouse-color . "SteelBlue"))
((cua-global-mark-cursor-color . "cyan")
(cua-normal-cursor-color . "red")
(cua-overwrite-cursor-color . "yellow")
(cua-read-only-cursor-color . "darkgreen")
(list-matching-lines-buffer-name-face . underline)
(list-matching-lines-face . bold)
(rmail-highlight-face . rmail-highlight)
(view-highlight-face . highlight)
(widget-mouse-face . highlight))
(default ((t (:stipple nil
:background "Black"
:foreground "SteelBlue"
:inverse-video nil
:box nil
:strike-through nil
:overline nil
:underline nil
:slant normal
:weight normal
:height 160
:width normal
:family "proggycleantt"))))
(bg:erc-color-face0 ((t (:background "White"))))
(bg:erc-color-face1 ((t (:background "black"))))
(bg:erc-color-face2 ((t (:background "blue4"))))
(bg:erc-color-face3 ((t (:background "green4"))))
(bg:erc-color-face4 ((t (:background "red"))))
(bg:erc-color-face5 ((t (:background "brown"))))
(bg:erc-color-face6 ((t (:background "purple"))))
(bg:erc-color-face7 ((t (:background "orange"))))
(bg:erc-color-face8 ((t (:background "yellow"))))
(bg:erc-color-face9 ((t (:background "green"))))
(bg:erc-color-face10 ((t (:background "lightblue1"))))
(bg:erc-color-face11 ((t (:background "cyan"))))
(bg:erc-color-face12 ((t (:background "blue"))))
(bg:erc-color-face13 ((t (:background "deeppink"))))
(bg:erc-color-face14 ((t (:background "gray50"))))
(bg:erc-color-face15 ((t (:background "gray90"))))
(bold ((t (:bold t :weight bold))))
(bold-italic ((t (:italic t :bold t :slant italic :weight bold))))
(border ((t (:background "black"))))
(buffer-menu-buffer ((t (:bold t :weight bold))))
(button ((t (:underline t))))
(comint-highlight-input ((t (:bold t :weight bold))))
(comint-highlight-prompt ((t (:foreground "cyan"))))
(completions-common-part ((t (:family "proggycleantt" :width normal :weight normal :slant normal :underline nil :overline nil :strike-through nil :box nil :inverse-video nil :foreground "SteelBlue" :background "Black" :stipple nil :height 160))))
(completions-first-difference ((t (:bold t :weight bold))))
(cua-global-mark ((t (:background "yellow1" :foreground "black"))))
(cua-rectangle ((t (:background "maroon" :foreground "white"))))
(cua-rectangle-noselect ((t (:background "dimgray" :foreground "white"))))
(cursor ((t (:background "Red"))))
(custom-button ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style released-button)))))
(custom-button-mouse ((t (:background "grey90" :foreground "black" :box (:line-width 2 :style released-button)))))
(custom-button-pressed ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :style pressed-button)))))
(custom-button-pressed-unraised ((t (:underline t :foreground "violet"))))
(custom-button-unraised ((t (:underline t))))
(custom-changed ((t (:background "blue1" :foreground "white"))))
(custom-comment ((t (:background "dim gray"))))
(custom-comment-tag ((t (:foreground "gray80"))))
(custom-documentation ((t (nil))))
(custom-face-tag ((t (:bold t :family "helv" :weight bold :height 1.2))))
(custom-group-tag ((t (:bold t :foreground "light blue" :weight bold :height 1.2))))
(custom-group-tag-1 ((t (:bold t :family "helv" :foreground "pink" :weight bold :height 1.2))))
(custom-invalid ((t (:background "red1" :foreground "yellow1"))))
(custom-link ((t (:underline t :foreground "cyan1"))))
(custom-modified ((t (:background "blue1" :foreground "white"))))
(custom-rogue ((t (:background "black" :foreground "pink"))))
(custom-saved ((t (:underline t))))
(custom-set ((t (:background "white" :foreground "blue1"))))
(custom-state ((t (:foreground "lime green"))))
(custom-themed ((t (:background "blue1" :foreground "white"))))
(custom-variable-button ((t (:bold t :underline t :weight bold))))
(custom-variable-tag ((t (:bold t :family "helv" :foreground "light blue" :weight bold :height 1.2))))
(erc-action-face ((t (:bold t :weight bold))))
(erc-bold-face ((t (:bold t :weight bold))))
(erc-dangerous-host-face ((t (:foreground "red"))))
(erc-default-face ((t (nil))))
(erc-direct-msg-face ((t (:foreground "IndianRed"))))
(erc-error-face ((t (:background "Red" :foreground "White"))))
(erc-fool-face ((t (:foreground "dim gray"))))
(erc-input-face ((t (:foreground "brown"))))
(erc-inverse-face ((t (:background "Black" :foreground "White"))))
(erc-keyword-face ((t (:bold t :foreground "pale green" :weight bold))))
(erc-notice-face ((t (:bold t :foreground "SlateBlue" :weight bold))))
(erc-pal-face ((t (:bold t :foreground "Magenta" :weight bold))))
(erc-prompt-face ((t (:bold t :background "lightBlue2" :foreground "Black" :weight bold))))
(erc-timestamp-face ((t (:bold t :foreground "green" :weight bold))))
(erc-underline-face ((t (:underline t))))
(escape-glyph ((t (:foreground "cyan"))))
(fg:erc-color-face0 ((t (:foreground "White"))))
(fg:erc-color-face1 ((t (:foreground "black"))))
(fg:erc-color-face10 ((t (:foreground "lightblue1"))))
(fg:erc-color-face11 ((t (:foreground "cyan"))))
(fg:erc-color-face12 ((t (:foreground "blue"))))
(fg:erc-color-face13 ((t (:foreground "deeppink"))))
(fg:erc-color-face14 ((t (:foreground "gray50"))))
(fg:erc-color-face15 ((t (:foreground "gray90"))))
(fg:erc-color-face2 ((t (:foreground "blue4"))))
(fg:erc-color-face3 ((t (:foreground "green4"))))
(fg:erc-color-face4 ((t (:foreground "red"))))
(fg:erc-color-face5 ((t (:foreground "brown"))))
(fg:erc-color-face6 ((t (:foreground "purple"))))
(fg:erc-color-face7 ((t (:foreground "orange"))))
(fg:erc-color-face8 ((t (:foreground "yellow"))))
(fg:erc-color-face9 ((t (:foreground "green"))))
(file-name-shadow ((t (:foreground "grey70"))))
(fixed-pitch ((t (:family "courier"))))
(font-lock-builtin-face ((t (:foreground "LightSteelBlue"))))
(font-lock-comment-delimiter-face ((t (:foreground "chocolate1"))))
(font-lock-comment-face ((t (:foreground "chocolate1"))))
(font-lock-constant-face ((t (:foreground "Aquamarine"))))
(font-lock-doc-face ((t (:foreground "LightSalmon"))))
(font-lock-doc-string-face ((t (:foreground "LightSalmon"))))
(font-lock-function-name-face ((t (:foreground "LightSkyBlue"))))
(font-lock-keyword-face ((t (:foreground "Cyan1"))))
(font-lock-negation-char-face ((t (nil))))
(font-lock-preprocessor-face ((t (:foreground "LightSteelBlue"))))
(font-lock-reference-face ((t (:foreground "LightSteelBlue"))))
(font-lock-regexp-grouping-backslash ((t (:bold t :weight bold))))
(font-lock-regexp-grouping-construct ((t (:bold t :weight bold))))
(font-lock-string-face ((t (:foreground "LightSalmon"))))
(font-lock-type-face ((t (:foreground "PaleGreen"))))
(font-lock-variable-name-face ((t (:foreground "LightGoldenrod"))))
(font-lock-warning-face ((t (:bold t :foreground "Pink" :weight bold))))
(fringe ((t (:background "grey10"))))
(gnus-group-mail-1-empty-face ((t (:foreground "aquamarine1"))))
(gnus-group-mail-1-face ((t (:bold t :foreground "aquamarine1" :weight bold))))
(gnus-group-mail-2-empty-face ((t (:foreground "aquamarine2"))))
(gnus-group-mail-2-face ((t (:bold t :foreground "aquamarine2" :weight bold))))
(gnus-group-mail-3-empty-face ((t (:foreground "aquamarine3"))))
(gnus-group-mail-3-face ((t (:bold t :foreground "aquamarine3" :weight bold))))
(gnus-group-mail-low-empty-face ((t (:foreground "aquamarine4"))))
(gnus-group-mail-low-face ((t (:bold t :foreground "aquamarine4" :weight bold))))
(gnus-group-news-1-empty-face ((t (:foreground "PaleTurquoise"))))
(gnus-group-news-1-face ((t (:bold t :foreground "PaleTurquoise" :weight bold))))
(gnus-group-news-2-empty-face ((t (:foreground "turquoise"))))
(gnus-group-news-2-face ((t (:bold t :foreground "turquoise" :weight bold))))
(gnus-group-news-3-empty-face ((t (nil))))
(gnus-group-news-3-face ((t (:bold t :weight bold))))
(gnus-group-news-4-empty-face ((t (nil))))
(gnus-group-news-4-face ((t (:bold t :weight bold))))
(gnus-group-news-5-empty-face ((t (nil))))
(gnus-group-news-5-face ((t (:bold t :weight bold))))
(gnus-group-news-6-empty-face ((t (nil))))
(gnus-group-news-6-face ((t (:bold t :weight bold))))
(gnus-group-news-low-empty-face ((t (:foreground "DarkTurquoise"))))
(gnus-group-news-low-face ((t (:bold t :foreground "DarkTurquoise" :weight bold))))
(gnus-splash-face ((t (:foreground "Brown"))))
(gnus-summary-cancelled-face ((t (:background "black" :foreground "yellow"))))
(gnus-summary-high-ancient-face ((t (:bold t :foreground "SkyBlue" :weight bold))))
(gnus-summary-high-read-face ((t (:bold t :foreground "PaleGreen" :weight bold))))
(gnus-summary-high-ticked-face ((t (:bold t :foreground "pink" :weight bold))))
(gnus-summary-high-unread-face ((t (:bold t :weight bold))))
(gnus-summary-low-ancient-face ((t (:italic t :foreground "SkyBlue" :slant italic))))
(gnus-summary-low-read-face ((t (:italic t :foreground "PaleGreen" :slant italic))))
(gnus-summary-low-ticked-face ((t (:italic t :foreground "pink" :slant italic))))
(gnus-summary-low-unread-face ((t (:italic t :slant italic))))
(gnus-summary-normal-ancient-face ((t (:foreground "SkyBlue"))))
(gnus-summary-normal-read-face ((t (:foreground "PaleGreen"))))
(gnus-summary-normal-ticked-face ((t (:foreground "pink"))))
(gnus-summary-normal-unread-face ((t (nil))))
(gnus-summary-selected-face ((t (:underline t))))
(header-line ((t (:box (:line-width -1 :style released-button) :background "grey20" :foreground "grey90" :box nil))))
(help-argument-name ((t (:italic t :slant italic))))
(highlight ((t (:background "darkolivegreen"))))
(isearch ((t (:background "palevioletred2" :foreground "brown4"))))
(italic ((t (:italic t :slant italic))))
(lazy-highlight ((t (:background "paleturquoise4"))))
(link ((t (:foreground "cyan1" :underline t))))
(link-visited ((t (:underline t :foreground "violet"))))
(mac-ts-block-fill-text ((t (:underline t))))
(mac-ts-caret-position ((t (nil))))
(mac-ts-converted-text ((t (:underline "gray20"))))
(mac-ts-no-hilite ((t (:family "proggycleantt" :width normal :weight normal :slant normal :underline nil :overline nil :strike-through nil :box nil :inverse-video nil :foreground "SteelBlue" :background "Black" :stipple nil :height 160))))
(mac-ts-outline-text ((t (:underline t))))
(mac-ts-raw-text ((t (:underline t))))
(mac-ts-selected-converted-text ((t (:underline t))))
(mac-ts-selected-raw-text ((t (:underline t))))
(mac-ts-selected-text ((t (:underline t))))
(match ((t (:background "RoyalBlue3"))))
(menu ((t (nil))))
(message-cited-text-face ((t (:foreground "red"))))
(message-header-cc-face ((t (:bold t :foreground "green4" :weight bold))))
(message-header-name-face ((t (:foreground "DarkGreen"))))
(message-header-newsgroups-face ((t (:italic t :bold t :foreground "yellow" :slant italic :weight bold))))
(message-header-other-face ((t (:foreground "#b00000"))))
(message-header-subject-face ((t (:foreground "green3"))))
(message-header-to-face ((t (:bold t :foreground "green2" :weight bold))))
(message-header-xheader-face ((t (:foreground "blue"))))
(message-mml-face ((t (:foreground "ForestGreen"))))
(message-separator-face ((t (:foreground "blue3"))))
(minibuffer-prompt ((t (:foreground "cyan"))))
(mode-line ((t (:background "grey75" :foreground "black" :box (:line-width -1 :style released-button)))))
(mode-line-buffer-id ((t (:bold t :weight bold))))
(mode-line-highlight ((t (:box (:line-width 2 :color "grey40" :style released-button)))))
(mode-line-inactive ((t (:background "grey30" :foreground "grey80" :box (:line-width -1 :color "grey40" :style nil) :weight light))))
(modeline-mousable ((t (:background "Gray10" :foreground "SteelBlue" :box (:line-width 1 :style none) :width condensed :family "neep"))))
(modeline-mousable-minor-mode ((t (:background "Gray10" :foreground "SteelBlue" :box (:line-width 1 :style none) :width condensed :family "neep"))))
(mouse ((t (:background "SteelBlue"))))
(next-error ((t (:background "blue3"))))
(nobreak-space ((t (:foreground "cyan" :underline t))))
(notify-user-of-mode ((t (:foreground "cyan"))))
(primary-selection ((t (:background "blue3"))))
(query-replace ((t (:foreground "brown4" :background "palevioletred2"))))
(region ((t (:background "blue3"))))
(scroll-bar ((t (:background "grey75"))))
(secondary-selection ((t (:background "SkyBlue4"))))
(shadow ((t (:foreground "grey70"))))
(show-paren-match ((t (:background "steelblue3"))))
(show-paren-mismatch ((t (:background "purple" :foreground "white"))))
(speedbar-button-face ((t (:foreground "green3"))))
(speedbar-directory-face ((t (:foreground "light blue"))))
(speedbar-file-face ((t (:foreground "cyan"))))
(speedbar-highlight-face ((t (:background "sea green"))))
(speedbar-selected-face ((t (:foreground "red" :underline t))))
(speedbar-tag-face ((t (:foreground "yellow"))))
(tool-bar ((t (:background "#eaeaea" :foreground "black" :box (:line-width 1 :style released-button)))))
(tooltip ((t (:background "lightyellow" :foreground "black" :height 100 :family "lucida sans"))))
(trailing-whitespace ((t (:background "red1"))))
(underline ((t (:underline t))))
(variable-pitch ((t (:family "helv"))))
(vertical-border ((t (nil))))
(widget-button ((t (:bold t :weight bold))))
(widget-button-pressed ((t (:foreground "red1"))))
(widget-documentation ((t (:foreground "lime green"))))
(widget-field ((t (:background "dim gray"))))
(widget-inactive ((t (:foreground "grey70"))))
(widget-single-line-field ((t (:background "dim gray"))))
(zmacs-region ((t (:background "blue3")))))
(font . "-apple-proggycleantt-medium-r-normal--16-0-72-72-m-0-iso10646-1") (tool-bar-lines . 0))))))
;;}}}
)
(when aquamacs
(one-buffer-one-frame-mode 0) ;; Let new buffers open in existing frames.
(setq confirm-kill-emacs 'y-or-n-p))
;; how patronizing could an editor possibly be? 'y' will do...
(fset 'yes-or-no-p 'y-or-n-p)
;; Toggle word wrap
(defun _dbl/toggle-word-wrap ()
(interactive "")
(if (eval truncate-lines) (setq truncate-lines nil) (setq truncate-lines t)))
;; Switch back a window
(defun _dbl/go-back-window ()
(interactive "")
(select-window (previous-window)))
;; Window splitter function for programming compiled languages
(defun _dbl/splitter () (interactive "")
(split-window-horizontally) (select-window (previous-window))
(split-window-vertically) (shrink-window-horizontally 18)
(shell) (select-window (next-window)) (select-window (next-window)))
;; Instead of pressing Enter, Tab all the time...
(defun set-newline-and-indent ()
(local-set-key "\C-m" 'newline-and-indent))
;; Inserts a basic doctype declaration, etc. for XHTML 1.0 script
(defun insert-xhtml-strict-skeleton ()
(interactive)
(insert "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t<meta http-equiv=\"Content-Language\" content=\"en\" />\n\t\t<title></title>\n\t</head>\n\t<body>\n\n\n\t</body>\n</html>"))
;; Aquamacs functions.
(when aquamacs
;; Open new window. Cmd+N
(defun _dbl/aqua/new-frame ()
(interactive)
(let ((one-buffer-one-frame t))
(new-frame-with-new-scratch)))
;; Close window. Cmd+W
(defun _dbl/aqua/close-frame ()
(interactive)
(let ((one-buffer-one-frame t))
(close-current-window-asktosave)))
;; Print. Cmd+P
(defun _dbl/aqua/print ()
(interactive)
(folding-open-buffer)
(new-frame)
(color-theme-tiger-xcode)
(aquamacs-print)
(delete-window)))
;;{{{ \C-<key>
;(global-set-key "\C-1")
;(global-set-key "\C-!")
;(global-set-key "\C-2")
;(global-set-key "\C-@")
;(global-set-key "\C-3")
;(global-set-key "\C-#")
;(global-set-key "\C-4")
;(global-set-key "\C-$")
;(global-set-key "\C-5")
;(global-set-key "\C-%")
;(global-set-key "\C-6")
;(global-set-key "\C-^")
;(global-set-key "\C-7")
;(global-set-key "\C-&")
;(global-set-key "\C-8")
;(global-set-key "\C-*")
;(global-set-key "\C-9")
;(global-set-key "\C-(")
;(global-set-key "\C-0")
;(global-set-key "\C-)")
;(global-set-key "\C--")
;(global-set-key "\C-_")
;(global-set-key "\C-=")
;(global-set-key "\C-+")
;(global-set-key "\C-q")
;(global-set-key "\C-Q")
(global-set-key "\C-w" 'backward-kill-word)
;(global-set-key "\C-W")
;(global-set-key "\C-e")
;(global-set-key "\C-E")
;(global-set-key "\C-r")
;(global-set-key "\C-R")
;(global-set-key "\C-t")
;(global-set-key "\C-T")
;(global-set-key "\C-y")
;(global-set-key "\C-Y")
;(global-set-key "\C-u")
;(global-set-key "\C-U")
;(global-set-key "\C-i")
;(global-set-key "\C-I")
;(global-set-key "\C-o")
;(global-set-key "\C-O")
;(global-set-key "\C-p")
;(global-set-key "\C-P")
;(global-set-key "\C-[")
;(global-set-key "\C-{")
;(global-set-key "\C-]")
;(global-set-key "\C-}")
;(global-set-key "\C-a")
;(global-set-key "\C-A")
;(global-set-key "\C-s")
;(global-set-key "\C-S")
;(global-set-key "\C-d")
;(global-set-key "\C-D")
;(global-set-key "\C-f")
;(global-set-key "\C-F")
;(global-set-key "\C-g")
;(global-set-key "\C-G")
;(global-set-key "\C-h")
;(global-set-key "\C-H")
;(global-set-key "\C-j")
;(global-set-key "\C-J")
;(global-set-key "\C-k")
;(global-set-key "\C-K")
;(global-set-key "\C-l")
;(global-set-key "\C-L")
;(global-set-key "\C-;")
;(global-set-key "\C-:")
;(global-set-key "\C-'")
;(global-set-key "\C-\"")
;(global-set-key "\C-z")
;(global-set-key "\C-Z")
;(global-set-key "\C-x") <<--- do not use
;(global-set-key "\C-X")
;(global-set-key "\C-c") <<--- do not use
;(global-set-key "\C-C")
;(global-set-key "\C-v")
;(global-set-key "\C-V")
;(global-set-key "\C-b")
;(global-set-key "\C-B")
;(global-set-key "\C-n")
;(global-set-key "\C-N")
;(global-set-key "\C-m")
;(global-set-key "\C-M")
;(global-set-key "\C-,")
;(global-set-key "\C-<")
;(global-set-key "\C-.")
;(global-set-key "\C->")
;(global-set-key "\C-/")
;(global-set-key "\C-?")
;(global-set-key "\C-\\")
;(global-set-key "\C-|")
;;}}}
;;{{{ \C-x<key>
;(global-set-key "\C-x1")
;(global-set-key "\C-x!")
;(global-set-key "\C-x2")
;(global-set-key "\C-x@")
;(global-set-key "\C-x3")
;(global-set-key "\C-x#")
;(global-set-key "\C-x4")
;(global-set-key "\C-x$")
;(global-set-key "\C-x5")
;(global-set-key "\C-x%")
;(global-set-key "\C-x6")
;(global-set-key "\C-x^")
;(global-set-key "\C-x7")
;(global-set-key "\C-x&")
;(global-set-key "\C-x8")
;(global-set-key "\C-x*")
;(global-set-key "\C-x9")
;(global-set-key "\C-x(")
;(global-set-key "\C-x0")
;(global-set-key "\C-x)")
;(global-set-key "\C-x-")
;(global-set-key "\C-x_")
;(global-set-key "\C-x=")
;(global-set-key "\C-x+")
;(global-set-key "\C-xq")
;(global-set-key "\C-xQ")
;(global-set-key "\C-xw")
;(global-set-key "\C-xW")
;(global-set-key "\C-xe")
;(global-set-key "\C-xE")
;(global-set-key "\C-xr")
;(global-set-key "\C-xR")
;(global-set-key "\C-xt")
;(global-set-key "\C-xT")
;(global-set-key "\C-xy")
;(global-set-key "\C-xY")
;(global-set-key "\C-xu")
;(global-set-key "\C-xU")
;(global-set-key "\C-xi")
;(global-set-key "\C-xI")
;(global-set-key "\C-xo")
;(global-set-key "\C-xO")
;(global-set-key "\C-xp")
;(global-set-key "\C-xP")
;(global-set-key "\C-x[")
;(global-set-key "\C-x{")
;(global-set-key "\C-x]")
;(global-set-key "\C-x}")
;(global-set-key "\C-xa")
;(global-set-key "\C-xA")
;(global-set-key "\C-xs")
;(global-set-key "\C-xS")
;(global-set-key "\C-xd")
;(global-set-key "\C-xD")
;(global-set-key "\C-xf")
;(global-set-key "\C-xF")
;(global-set-key "\C-xg")
;(global-set-key "\C-xG")
;(global-set-key "\C-xh")
;(global-set-key "\C-xH")
;(global-set-key "\C-xj")
;(global-set-key "\C-xJ")
;(global-set-key "\C-xk")
;(global-set-key "\C-xK")
;(global-set-key "\C-xl")
;(global-set-key "\C-xL")
;(global-set-key "\C-x;")
;(global-set-key "\C-x:")
;(global-set-key "\C-x'")
;(global-set-key "\C-x\"")
;(global-set-key "\C-xz")
;(global-set-key "\C-xZ")
;(global-set-key "\C-xx")
;(global-set-key "\C-xX")
;(global-set-key "\C-xc")
;(global-set-key "\C-xC")
;(global-set-key "\C-xv")
;(global-set-key "\C-xV")
;(global-set-key "\C-xb")
;(global-set-key "\C-xB")
;(global-set-key "\C-xn")
;(global-set-key "\C-xN")
(global-set-key "\C-xm" 'execute-extended-command)
;(global-set-key "\C-xM")
;(global-set-key "\C-x,")
;(global-set-key "\C-x<")
;(global-set-key "\C-x.")
;(global-set-key "\C-x>")
;(global-set-key "\C-x/")
;(global-set-key "\C-x?")
;(global-set-key "\C-x\\")
;(global-set-key "\C-x|")
;;}}}
;;{{{ \C-x\C-<key>
;(global-set-key "\C-x\C-1")
;(global-set-key "\C-x\C-!")
;(global-set-key "\C-x\C-2")
;(global-set-key "\C-x\C-@")
;(global-set-key "\C-x\C-3")
;(global-set-key "\C-x\C-#")
;(global-set-key "\C-x\C-4")
;(global-set-key "\C-x\C-$")
;(global-set-key "\C-x\C-5")
;(global-set-key "\C-x\C-%")
;(global-set-key "\C-x\C-6")
;(global-set-key "\C-x\C-^")
;(global-set-key "\C-x\C-7")
;(global-set-key "\C-x\C-&")
;(global-set-key "\C-x\C-8")
;(global-set-key "\C-x\C-*")
;(global-set-key "\C-x\C-9")
;(global-set-key "\C-x\C-(")
;(global-set-key "\C-x\C-0")
;(global-set-key "\C-x\C-)")
;(global-set-key "\C-x\C--")
;(global-set-key "\C-x\C-_")
;(global-set-key "\C-x\C-=")
;(global-set-key "\C-x\C-+")
;(global-set-key "\C-x\C-q")
;(global-set-key "\C-x\C-Q")
;(global-set-key "\C-x\C-w")
;(global-set-key "\C-x\C-W")
;(global-set-key "\C-x\C-e")
;(global-set-key "\C-x\C-E")
(global-set-key "\C-x\C-r" 'query-replace-regexp)
;(global-set-key "\C-x\C-R")
;(global-set-key "\C-x\C-t")
;(global-set-key "\C-x\C-T")
;(global-set-key "\C-x\C-y")
;(global-set-key "\C-x\C-Y")
;(global-set-key "\C-x\C-u")
;(global-set-key "\C-x\C-U")
;(global-set-key "\C-x\C-i")
;(global-set-key "\C-x\C-I")
;(global-set-key "\C-x\C-o")
;(global-set-key "\C-x\C-O")
;(global-set-key "\C-x\C-p")
;(global-set-key "\C-x\C-P")
;(global-set-key "\C-x\C-[")
;(global-set-key "\C-x\C-{")
;(global-set-key "\C-x\C-]")
;(global-set-key "\C-x\C-}")
;(global-set-key "\C-x\C-a")
;(global-set-key "\C-x\C-A")
;(global-set-key "\C-x\C-s")
;(global-set-key "\C-x\C-S")
;(global-set-key "\C-x\C-d")
;(global-set-key "\C-x\C-D")
;(global-set-key "\C-x\C-f")
;(global-set-key "\C-x\C-F")
;(global-set-key "\C-x\C-g")
;(global-set-key "\C-x\C-G")
;(global-set-key "\C-x\C-h")
;(global-set-key "\C-x\C-H")
;(global-set-key "\C-x\C-j")
;(global-set-key "\C-x\C-J")
(global-set-key "\C-x\C-k" 'kill-region)
;(global-set-key "\C-x\C-K")
;(global-set-key "\C-x\C-l")
;(global-set-key "\C-x\C-L")
;(global-set-key "\C-x\C-;")
;(global-set-key "\C-x\C-:")
;(global-set-key "\C-x\C-'")
;(global-set-key "\C-x\C-\"")
;(global-set-key "\C-x\C-z")
;(global-set-key "\C-x\C-Z")
;(global-set-key "\C-x\C-x")
;(global-set-key "\C-x\C-X")
;(global-set-key "\C-x\C-c")
;(global-set-key "\C-x\C-C")
;(global-set-key "\C-x\C-v")
;(global-set-key "\C-x\C-V")
;(global-set-key "\C-x\C-b")
;(global-set-key "\C-x\C-B")
;(global-set-key "\C-x\C-n")
;(global-set-key "\C-x\C-N")
(global-set-key "\C-x\C-m" 'execute-extended-command)
;(global-set-key "\C-x\C-M")
;(global-set-key "\C-x\C-,")
;(global-set-key "\C-x\C-<")
;(global-set-key "\C-x\C-.")
;(global-set-key "\C-x\C->")
;(global-set-key "\C-x\C-/")
;(global-set-key "\C-x\C-?")
;(global-set-key "\C-x\C-\\")
;(global-set-key "\C-x\C-|")
;;}}}
;;{{{ \C-c<key>
;(global-set-key "\C-c1")
;(global-set-key "\C-c!")
;(global-set-key "\C-c2")
;(global-set-key "\C-c@")
;(global-set-key "\C-c3")
;(global-set-key "\C-c#")
;(global-set-key "\C-c4")
;(global-set-key "\C-c$")
;(global-set-key "\C-c5")
;(global-set-key "\C-c%")
;(global-set-key "\C-c6")
;(global-set-key "\C-c^")
;(global-set-key "\C-c7")
;(global-set-key "\C-c&")
;(global-set-key "\C-c8")
;(global-set-key "\C-c*")
;(global-set-key "\C-c9")
;(global-set-key "\C-c(")
;(global-set-key "\C-c0")
;(global-set-key "\C-c)")
;(global-set-key "\C-c-")
;(global-set-key "\C-c_")
;(global-set-key "\C-c=")
;(global-set-key "\C-c+")
;(global-set-key "\C-cq")
;(global-set-key "\C-cQ")
(global-set-key "\C-cw" '_dbl/toggle-word-wrap)
;(global-set-key "\C-cW")
;(global-set-key "\C-ce")
;(global-set-key "\C-cE")
;(global-set-key "\C-cr")
;(global-set-key "\C-cR")
;(global-set-key "\C-ct")
;(global-set-key "\C-cT")
;(global-set-key "\C-cy")
;(global-set-key "\C-cY")
;(global-set-key "\C-cu")
;(global-set-key "\C-cU")
;(global-set-key "\C-ci")
;(global-set-key "\C-cI")
(global-set-key "\C-co" 'folding-open-buffer)
;(global-set-key "\C-cO")
;(global-set-key "\C-cp")
;(global-set-key "\C-cP")
;(global-set-key "\C-c[")
;(global-set-key "\C-c{")
;(global-set-key "\C-c]")
;(global-set-key "\C-c}")
;(global-set-key "\C-ca")
;(global-set-key "\C-cA")
(global-set-key "\C-cs" '_dbl/splitter)
;(global-set-key "\C-cS")
;(global-set-key "\C-cd")
;(global-set-key "\C-cD")
(global-set-key "\C-cf" 'folding-toggle-show-hide)
;(global-set-key "\C-cF")
(global-set-key "\C-cg" 'goto-line)
;(global-set-key "\C-cG")
;(global-set-key "\C-ch")
;(global-set-key "\C-cH")
;(global-set-key "\C-cj")
;(global-set-key "\C-cJ")
;(global-set-key "\C-ck")
;(global-set-key "\C-cK")
;(global-set-key "\C-cl")
;(global-set-key "\C-cL")
;(global-set-key "\C-c;")
;(global-set-key "\C-c:")
;(global-set-key "\C-c'")
;(global-set-key "\C-c\"")
;(global-set-key "\C-cz")
;(global-set-key "\C-cZ")
;(global-set-key "\C-cx")
;(global-set-key "\C-cX")
(global-set-key "\C-cc" 'folding-whole-buffer)
;(global-set-key "\C-cC")
;(global-set-key "\C-cv")
;(global-set-key "\C-cV")
;(global-set-key "\C-cb")
;(global-set-key "\C-cB")
;(global-set-key "\C-cn")
;(global-set-key "\C-cN")
(global-set-key "\C-cm" 'execute-extended-command)
;(global-set-key "\C-cM")
;(global-set-key "\C-c,")
;(global-set-key "\C-c<")
;(global-set-key "\C-c.")
;(global-set-key "\C-c>")
;(global-set-key "\C-c/")
;(global-set-key "\C-c?")
;(global-set-key "\C-c\\")
;(global-set-key "\C-c|")
;;}}}
;;{{{ \C-c\C-<key>
;(global-set-key "\C-c\C-1")
;(global-set-key "\C-c\C-!")
;(global-set-key "\C-c\C-2")
;(global-set-key "\C-c\C-@")
;(global-set-key "\C-c\C-3")
;(global-set-key "\C-c\C-#")
;(global-set-key "\C-c\C-4")
;(global-set-key "\C-c\C-$")
;(global-set-key "\C-c\C-5")
;(global-set-key "\C-c\C-%")
;(global-set-key "\C-c\C-6")
;(global-set-key "\C-c\C-^")
;(global-set-key "\C-c\C-7")
;(global-set-key "\C-c\C-&")
;(global-set-key "\C-c\C-8")
;(global-set-key "\C-c\C-*")
;(global-set-key "\C-c\C-9")
;(global-set-key "\C-c\C-(")
;(global-set-key "\C-c\C-0")
;(global-set-key "\C-c\C-)")
;(global-set-key "\C-c\C--")
;(global-set-key "\C-c\C-_")
;(global-set-key "\C-c\C-=")
;(global-set-key "\C-c\C-+")
;(global-set-key "\C-c\C-q")
;(global-set-key "\C-c\C-Q")
;(global-set-key "\C-c\C-w")
;(global-set-key "\C-c\C-W")
;(global-set-key "\C-c\C-e")
;(global-set-key "\C-c\C-E")
;(global-set-key "\C-c\C-r")
;(global-set-key "\C-c\C-R")
;(global-set-key "\C-c\C-t")
;(global-set-key "\C-c\C-T")
;(global-set-key "\C-c\C-y")
;(global-set-key "\C-c\C-Y")
;(global-set-key "\C-c\C-u")
;(global-set-key "\C-c\C-U")
;(global-set-key "\C-c\C-i")
;(global-set-key "\C-c\C-I")
;(global-set-key "\C-c\C-o")
;(global-set-key "\C-c\C-O")
;(global-set-key "\C-c\C-p")
;(global-set-key "\C-c\C-P")
;(global-set-key "\C-c\C-[")
;(global-set-key "\C-c\C-{")
;(global-set-key "\C-c\C-]")
;(global-set-key "\C-c\C-}")
;(global-set-key "\C-c\C-a")
;(global-set-key "\C-c\C-A")
(global-set-key "\C-c\C-s" 'speedbar)
;(global-set-key "\C-c\C-S")
;(global-set-key "\C-c\C-d")
;(global-set-key "\C-c\C-D")
;(global-set-key "\C-c\C-f")
;(global-set-key "\C-c\C-F")
;(global-set-key "\C-c\C-g")
;(global-set-key "\C-c\C-G")
;(global-set-key "\C-c\C-h")
;(global-set-key "\C-c\C-H")
;(global-set-key "\C-c\C-j")
;(global-set-key "\C-c\C-J")
(global-set-key "\C-c\C-k" 'kill-region)
;(global-set-key "\C-c\C-K")
;(global-set-key "\C-c\C-l")
;(global-set-key "\C-c\C-L")
;(global-set-key "\C-c\C-;")
;(global-set-key "\C-c\C-:")
;(global-set-key "\C-c\C-'")
;(global-set-key "\C-c\C-\"")
;(global-set-key "\C-c\C-z")
;(global-set-key "\C-c\C-Z")
;(global-set-key "\C-c\C-x")
;(global-set-key "\C-c\C-X")
;(global-set-key "\C-c\C-c")
;(global-set-key "\C-c\C-C")
;(global-set-key "\C-c\C-v")
;(global-set-key "\C-c\C-V")
;(global-set-key "\C-c\C-b")
;(global-set-key "\C-c\C-B")
;(global-set-key "\C-c\C-n")
;(global-set-key "\C-c\C-N")
(global-set-key "\C-c\C-m" 'execute-extended-command)
;(global-set-key "\C-c\C-M")
;(global-set-key "\C-c\C-,")
;(global-set-key "\C-c\C-<")
;(global-set-key "\C-c\C-.")
;(global-set-key "\C-c\C->")
;(global-set-key "\C-c\C-/")
;(global-set-key "\C-c\C-?")
;(global-set-key "\C-c\C-\\")
;(global-set-key "\C-c\C-|")
;;}}}
;;{{{ \M-<key>
;(global-set-key "\M-1")
;(global-set-key "\M-!")
;(global-set-key "\M-2")
;(global-set-key "\M-@")
;(global-set-key "\M-3")
;(global-set-key "\M-#")
;(global-set-key "\M-4")
;(global-set-key "\M-$")
;(global-set-key "\M-5")
;(global-set-key "\M-%")
;(global-set-key "\M-6")
;(global-set-key "\M-^")
;(global-set-key "\M-7")
;(global-set-key "\M-&")
;(global-set-key "\M-8")
;(global-set-key "\M-*")
;(global-set-key "\M-9")
;(global-set-key "\M-(")
;(global-set-key "\M-0")
;(global-set-key "\M-)")
;(global-set-key "\M--")
;(global-set-key "\M-_")
;(global-set-key "\M-=")
;(global-set-key "\M-+")
;(global-set-key "\M-q")
;(global-set-key "\M-Q")
;(global-set-key "\M-w")
;(global-set-key "\M-W")
;(global-set-key "\M-e")
;(global-set-key "\M-E")
(global-set-key "\M-r" 'isearch-backward-regexp)
;(global-set-key "\M-R")
;(global-set-key "\M-t")
;(global-set-key "\M-T")
;(global-set-key "\M-y")
;(global-set-key "\M-Y")
;(global-set-key "\M-u")
;(global-set-key "\M-U")
;(global-set-key "\M-i")
;(global-set-key "\M-I")
;(global-set-key "\M-o")
;(global-set-key "\M-O")
;(global-set-key "\M-p")
;(global-set-key "\M-P")
;(global-set-key "\M-[")
;(global-set-key "\M-{")
;(global-set-key "\M-]")
;(global-set-key "\M-}")
;(global-set-key "\M-a")
;(global-set-key "\M-A")
(global-set-key "\M-s" 'isearch-forward-regexp)
;(global-set-key "\M-S")
;(global-set-key "\M-d")
;(global-set-key "\M-D")
;(global-set-key "\M-f")
;(global-set-key "\M-F")
;(global-set-key "\M-g")
;(global-set-key "\M-G")
;(global-set-key "\M-h")
;(global-set-key "\M-H")
;(global-set-key "\M-j")
;(global-set-key "\M-J")
;(global-set-key "\M-k")
;(global-set-key "\M-K")
;(global-set-key "\M-l")
;(global-set-key "\M-L")
;(global-set-key "\M-;")
;(global-set-key "\M-:")
;(global-set-key "\M-'")
;(global-set-key "\M-\"")
;(global-set-key "\M-z")
;(global-set-key "\M-Z")
;(global-set-key "\M-x")
;(global-set-key "\M-X")
;(global-set-key "\M-c")
;(global-set-key "\M-C")
;(global-set-key "\M-v")
;(global-set-key "\M-V")
;(global-set-key "\M-b")
;(global-set-key "\M-B")
;(global-set-key "\M-n")
;(global-set-key "\M-N")
;(global-set-key "\M-m")
;(global-set-key "\M-M")
;(global-set-key "\M-,")
;(global-set-key "\M-<")
;(global-set-key "\M-.")
;(global-set-key "\M->")
;(global-set-key "\M-/")
;(global-set-key "\M-?")
;(global-set-key "\M-\\")
;(global-set-key "\M-|")
;;}}}
;; Aquamacs stuff
(when aquamacs
(define-key osx-key-mode-map (kbd "A-n") '_dbl/aqua/new-frame)
(define-key osx-key-mode-map (kbd "A-w") '_dbl/aqua/close-frame)
(define-key osx-key-mode-map (kbd "A-p") '_dbl/aqua/print))
;; Disable cursor keys.
;(global-set-key (kbd "<left>") '())
;(global-set-key (kbd "<right>") '())
;(global-set-key (kbd "<up>") '())
;(global-set-key (kbd "<down>") '())
;; Backups and Autosaves
(setq
backup-by-copying t ;; don't clobber symlinks
backup-directory-alist
'(("." . "~/.emacs.d/autosaves/")) ;; don't litter
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t) ;; use versioned backups
;; No syntax highlighting on plain text
(setq text-mode-hook 'turn-off-auto-fill)
;; C and C-ish
(add-hook 'c-mode-common-hook 'set-newline-and-indent)
;; Ruby
(add-hook 'ruby-mode-hook 'set-newline-and-indent)
;; Remote File Editing
(when (require 'tramp nil t)
(setq tramp-default-method "scp"))
;; Hippie Expand
(when (require 'hippie-expand nil t)
(global-set-key [C-tab] 'hippie-expand))
;; Code Folding
(when (require 'folding nil t)
(folding-add-to-marks-list 'ruby-mode "# {{{" "# }}}" nil t)
(folding-add-to-marks-list 'conf-space-mode "# {{{" "# }}}" nil t)
(folding-add-to-marks-list 'css-mode "/* {{{" "/* }}}" nil t)
(folding-add-to-marks-list 'nxml-mode "<!--{{{" "<!--}}}" nil t)
(add-hook 'find-file-hooks 'folding-mode))
;; PSVN
(setq svn-status-prefix-key '[(meta l)])
(require 'psvn)
(define-key svn-log-edit-mode-map [f6] 'svn-log-edit-svn-diff)
(defun xsteve-svn-log-edit-setup ()
(setq ispell-local-dictionary "english")
(auto-fill-mode 1))
(add-hook 'svn-log-edit-mode-hook 'xsteve-svn-log-edit-setup)
;; Use NXML for editing HTML
(setq auto-mode-alist
(nconc
'(("\\.xml$" . nxml-mode))
'(("\\.html$" . nxml-mode))
auto-mode-alist))
;; magic-modes just get in the way of nxml-mode in Aquamacs.
(setq magic-mode-alist ())
(when (require 'time-date nil t)
(message "Emacs startup time: %d seconds." (time-to-seconds (time-since emacs-load-start-time))))
(setq debug-on-error nil)