;; .emacs ;; =========================== ;; Behaviour ;; =========================== ;; turn off default start message (setq inhibit-startup-message t) ;; allow a display clock, which pings a machine every minute to ;; beat ComCast auto-logout (setq display-time-24hr-format t) (display-time-mode 1) ;; turn on font-lock mode (when (fboundp 'global-font-lock-mode) (global-font-lock-mode t)) ;; scroll just one line when hitting the bottom of the window (setq scroll-step 1) (setq scroll-conservatively 1) ;; default to better frame titles (setq frame-title-format (concat "%b - emacs@" system-name)) ;; Show the column number (column-number-mode t) ;; enable visual feedback on selections ;(setq transient-mark-mode t) ;;; uncomment this line to disable loading of "default.el" at startup ;; (setq inhibit-default-init t) ;; ============================ ;; Custom Variables ;; ============================ (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(case-fold-search t) '(current-language-environment "English") '(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify)))) ;'(show-paren-mode t nil (paren)) ;; ============================ ;; Colors ;; ============================ (when window-system (add-to-list 'default-frame-alist '(background-color . "black")) (add-to-list 'default-frame-alist '(foreground-color . "white"))) (set-background-color "black") (set-foreground-color "white") (set-face-foreground font-lock-comment-face "Red") (set-face-foreground font-lock-string-face "green") (set-face-foreground font-lock-doc-face "forest green") (set-face-foreground font-lock-keyword-face "cyan") (set-face-foreground font-lock-reference-face "dark orchid") (set-face-foreground font-lock-variable-name-face "gold") (set-face-foreground font-lock-function-name-face "RoyalBlue2") (set-face-foreground font-lock-doc-face "slate grey") (set-face-foreground font-lock-builtin-face "RoyalBlue2") ;; ============================ ;; Set up which modes to use for which file extensions ;; ============================ (setq auto-mode-alist (append '( ("\\.h$" . c++-mode) ("\\.dps$" . pascal-mode) ("\\.py$" . python-mode) ("\\.Xdefaults$" . xrdb-mode) ("\\.Xenvironment$" . xrdb-mode) ("\\.Xresources$" . xrdb-mode) ("\\.tei$" . xml-mode) ("\\.php$" . php-mode) ) auto-mode-alist)) ;;(setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist)) ;; =========================== ;; Buffer Navigation ;; ============================ (cond ((fboundp 'iswitchb-mode) ; GNU Emacs 21 (iswitchb-mode 1)) ((fboundp 'iswitchb-default-keybindings) ; Old-style activation (iswitchb-default-keybindings)) (t nil)) ; Oh well. ;; ============================ ;; Emacs Muse ;; ============================ ;(add-to-list 'load-path "~/web/source/emacs/muse") ;(load "muse-init") ; fix tab problem ;(local-unset-key (kbd "")) ;(local-set-key (kbd "") 'indent-relative) ;(add-hook 'muse-mode-hook ; (lambda () ; (local-set-key "\C-cd" 'insert-muse-date-header) ; (local-set-key (kbd "") 'indent-relative) ; )) ;; ============================ ;; Matlab-mode setp ;; ============================ ;; Add local lisp folder to load-path (setq load-path (append load-path (list "~/.matlab"))) ;; Set up matlab-mode to load on .m files (autoload 'matlab-mode "matlab" "Enter MATLAB mode." t) (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist)) (autoload 'matlab-shell "matlab" "Interactive MATLAB mode." t) ;; User Level customizations (You need not use them all): (setq matlab-indent-function t) ; if you want function bodies indented (setq matlab-verify-on-save-flag nil) ; turn off auto-verify on save (defun my-matlab-mode-hook () (setq fill-column 76)) ; where auto-fill should wrap (setq matlab-comment-region-s "% ") (add-hook 'matlab-mode-hook 'my-matlab-mode-hook) (defun my-matlab-shell-mode-hook () '()) (add-hook 'matlab-shell-mode-hook 'my-matlab-shell-mode-hook) (setq matlab-indent-level 2) ;; Turn off Matlab desktop (setq matlab-shell-command-switches '("-nojvm")) ;; ============================ ;; Set short-cut key strokes ;; ============================ (global-set-key "\C-x\C-m" 'execute-extended-command) (global-set-key "\C-w" 'backward-kill-word) (global-set-key "\C-j" 'backward-kill-word) (global-set-key "\C-x\C-k" 'kill-region) ; navigation (global-set-key (kbd "\C-x ") 'windmove-up) (global-set-key (kbd "\C-x ") 'windmove-down) (global-set-key (kbd "\C-x ") 'windmove-right) (global-set-key (kbd "\C-x ") 'windmove-left) (global-set-key "\C-u" 'forward-word) (global-set-key "\C-o" 'backward-word) ;; Devorak specific: "q" is my new "x" (global-unset-key "\C-q") (global-set-key "\C-q\C-o" 'save-buffer) (global-set-key "\C-q\C-j" 'save-buffers-kill-emacs) (global-set-key "\C-q\C-f" 'find-file) (global-set-key "\C-q\C-k" 'kill-region)