;; .emacs ;;; uncomment this line to disable loading of "default.el" at startup ;; (setq inhibit-default-init t) ;; =========================== ;; Behavior ;; =========================== ;; 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)) ;; enable visual feedback on selections ;(setq transient-mark-mode t) ;; default to better frame titles (setq frame-title-format (concat "%b - emacs@" system-name)) ;; ============================ ;; 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-keyword-face "cyan") (set-face-foreground 'font-lock-constant-face "dark orchid") (set-face-foreground font-lock-variable-name-face "gold") (set-face-foreground font-lock-function-name-face "blue") (set-face-foreground font-lock-doc-face "slate grey") (set-face-foreground font-lock-builtin-face "blue") ;; ============================ ;; 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") ;; ============================ ;; 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 (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) ;; Turn off Matlab desktop (setq matlab-shell-command-switches '("-nojvm")) ;; ============================ ;; Set short-cut key strokes ;; ============================ (global-set-key [(shift up)] 'windmove-up) (global-set-key [(shift down)] 'windmove-down) (global-set-key [(shift right)] 'windmove-right) (global-set-key [(shift left)] 'windmove-left) ;;(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-x\C-m" 'execute-extended-command) (global-set-key "\C-c\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) (global-set-key "\C-c\C-k" 'kill-region) (global-set-key "\C-f" 'forward-word) (global-set-key "\C-b" '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)