"REDACTED" indicates a personal detail i don't want to divulge
;; global setup
(setq scroll-step 1)
(set-input-mode nil nil t)
(setq-default indent-tabs-mode nil)
(setq next-line-add-newlines nil)
(setq-default make-backup-files nil)
(setq-default column-number-mode t)
(global-set-key "\C-l" `goto-line)
(global-set-key "\C-h" `delete-backward-char)
(global-set-key [mouse-2] 'yank)
(global-font-lock-mode 1)
(mouse-wheel-mode t)
(setq inhibit-splash-screen t)
(setq display-time-24hr-format t)
(display-time)
(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))
(if (fboundp 'blink-cursor-mode) (blink-cursor-mode 0))
(setq-default transient-mark-mode t)
(standard-display-ascii ?\221 [?\'])
(standard-display-ascii ?\223 [?\"])
(standard-display-ascii ?\224 [?\"])
(standard-display-ascii ?\225 [?+])
(standard-display-ascii ?\227 [?-])
(standard-display-ascii ?\222 [?'])
(standard-display-ascii ?\205 [?.?.?.])
(add-to-list 'load-path "~/.el")
(setq debug-on-error t)
;; macros
(fset 'switchbuffers
[?\C-x ?b])
(global-set-key (kbd "<f3>") 'switchbuffers)
(fset 'savebuffer
[?\C-x ?\C-s])
(global-set-key (kbd "<f4>") 'savebuffer)
(fset 'gotogroup
[?\C-x ?b ?* ?G ?r ?o ?u ?p ?* return])
(global-set-key (kbd "<f5>") 'gotogroup)
(fset 'purgemail
[?\C-c ?s ?B backspace ?q ?g])
(global-set-key (kbd "<f6>") 'purgemail)
(fset 'checkin-vcs
[?\C-x ?v ?v])
(global-set-key (kbd "<f7>") 'checkin-vcs)
(fset 'ctrlc-ctrlc
[?\C-c ?\C-c])
(global-set-key (kbd "<f8>") 'ctrlc-ctrlc)
(fset 'open-new-file
[?\C-x ?\C-f])
(global-set-key (kbd "<f9>") 'open-new-file)
(fset 'kill-this-buffer
[?\C-x ?k])
(global-set-key (kbd "<f10>") 'kill-this-buffer)
;; where are we being run?
(defun run-at-work ()
(string-match "REDACTED" (system-name)))
;; date/time funcs
(defun insert-time ()
(interactive)
(insert (format-time-string "%Y-%m-%d-%R")))
(defun insert-date ()
(interactive)
(insert (format-time-string "%Y-%m-%d")))
;; dos2unix
(defun dos2unix ()
(interactive)
(goto-char (point-min))
(while (search-forward "\r" nil t)
(replace-match "")))
;; dictionary lookup
(defun lookup ()
(interactive)
(setq lookup-term (read-string "term: "))
(shell-command (concat "dict -h dict.org \"" lookup-term "\"")))
;; erc shortcut
(defun yim ()
(interactive)
(erc :server "irc.net" :port "6667" :nick "REDACTED"))
;; wrap mode for text files
(autoload 'wrap-mode "~/.el/wrap-mode.el" "Toggle wrapping." t)
(setq auto-mode-alist (append '(("\\.txt$" . wrap-mode)) auto-mode-alist))
(global-set-key (kbd "C-x C-j") `wrap-mode)
;; haskell editing
(load "/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file.el")
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
;; eshell funcs
(load "~/.el/esh-proc.el")
;; scheme
(setq scheme-program-name "mzscheme")
;; w3m - rest of the config is in .emacs-w3m.el
(require 'w3m-load)
;; recursive find
(load "~/.el/find-recursive.el")
;; eshell
(setq eshell-prompt-function
(lambda ()
(if (= (user-uid) 0) " # " " $ ")))
(eval-after-load "em-term"
'(add-to-list 'eshell-visual-commands "git-log"))
(eval-after-load "em-term"
'(add-to-list 'eshell-visual-commands "tig"))
(eval-after-load "em-term"
'(add-to-list 'eshell-visual-commands "perldoc"))
;; bbdb
(add-to-list 'load-path "~/.el/bbdb")
(require 'bbdb)
(bbdb-initialize)
;; flymake
(eval-after-load "flymake"
'(progn
(defun flymake-haskell-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "ghc" (list "--make" local-file "-i"))))
(defvar flymake-ghc-options (list "-Wall -Werror"))
(defvar flymake-ghc-packages
(mapcar (lambda (p) (concat "-package " p))
'("QuickCheck")))
(defun flymake-get-haskell-cmdline (source base-dir)
(list "ghc"
(append
(list "--make" "-fno-code" (concat "-i" base-dir) source)
flymake-ghc-options
flymake-ghc-packages)))
(push '("\\.[hg]s$" flymake-haskell-init)
flymake-allowed-file-name-masks)
(push '("\\.l[hg]$" flymake-haskell-init)
flymake-allowed-file-name-masks)
(push '("^\\(.*\.hs\\|\.lhs\\):\\([0-9]+\\):\\([0-9]+\\): \\(\\(.*\n?\\)*\\)$"
1 2 3 4)
flymake-err-line-patterns)
(global-set-key [f3] 'flymake-display-err-menu-for-current-line)
(global-set-key [f4] 'flymake-goto-next-error)
(add-hook 'find-file-hook 'flymake-find-file-hook)))
(custom-set-variables
'(ecb-wget-setup (quote cons))
'(gnus-asynchronous t)
'(gnus-novice-user nil)
'(gnus-use-cache t)
'(message-mode-hook (quote (mail-text turn-on-auto-fill turn-on-font-lock mail-text not-modified)))
'(mm-inline-text-html-with-w3m-keymap t)
'(mm-text-html-renderer (quote w3m))
'(mumamo-chunk-coloring (quote no-chunks-colored))
'(nxhtml-skip-welcome t)
'(org-agenda-files (quote ("~/Org/todo.org")))
'(org-agenda-ndays 7)
'(org-agenda-show-all-dates t)
'(org-agenda-skip-deadline-if-done t)
'(org-agenda-skip-scheduled-if-done t)
'(org-agenda-start-on-weekday nil)
'(org-deadline-warning-days 14)
'(org-default-notes-file "~/Org/notes.org")
'(org-reverse-note-order t)
'(pgg-default-user-id "REDACTED")
'(pgg-query-keyserver nil))
last update 2008-04-05