(setq load-path (cons "/home/wu/" load-path)) (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) (setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist)) (autoload 'python-mode "python-mode" "Python editing mode." t) (autoload 'php-mode "php-mode" "Mode for editing PHP source files") (add-to-list 'auto-mode-alist '("\\.\\(inc\\|php[s34]?\\)" . php-mode)) ;;; add these lines if you like color-based syntax highlighting (global-font-lock-mode t) (setq font-lock-maximum-decoration t) (global-set-key "\C-h" 'delete-backward-char) ; backspace (global-set-key "\C-d" 'delete-char) ; delete (global-set-key "\M-?" 'help-command) ; help ;; do not make backup files ;;(setq make-backup-files nil) ;; Use centralized backups (setq backup-directory-alist `(("." . ,(expand-file-name "~/.emacs-backups")))) ;; wheel mouse (global-set-key [mouse-4] '(lambda () (interactive) (scroll-down 1))) (global-set-key [mouse-5] '(lambda () (interactive) (scroll-up 1))) ;; force the scroll to go one by one (setq scroll-step 1) ;; hide the menu bar ;; ;;(menu-bar-mode nil) (tool-bar-mode nil) (setq menubar-visible-p nil) (setq default-toolbar-visible-p nil) ;; hide the scroll bar ;; (scroll-bar-mode nil) ;; The following ones are set from within emacs, to activate parent highlight mode (custom-set-variables ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. '(case-fold-search t) '(current-language-environment "Latin-9") '(default-input-method "latin-9-prefix") '(global-font-lock-mode t nil (font-lock)) '(show-paren-mode t nil (paren)) '(transient-mark-mode t)) (custom-set-faces ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! ;; Your init file should contain only one such instance. ) ;; Require tramp (require 'tramp) (setq tramp-default-method "ssh") ;; Set the default font size ;;(set-frame-font "7x14") (set-frame-font "fixed") ;; Set the default encoding (set-language-environment "UTF-8") (require 'psvn) (load-file "~/src/dvc-snapshot/++build/dvc-load.el") (require 'po-mode) (require 'rst) (setq auto-mode-alist (append '(("\\.txt$" . rst-mode) ("\\.rst$" . rst-mode) ("\\.rest$" . rst-mode)) auto-mode-alist)) (add-hook 'rst-adjust-hook 'rst-toc-update) (require 'table) ;; Load color schemes (require 'color-theme) (color-theme-initialize) ;; set the color-theme-tango definition ;;; Color theme based on Tango Palette. Created by danranx@gmail.com (defun color-theme-tango () "A color theme based on Tango Palette." (interactive) (color-theme-install '(color-theme-tango ((background-color . "#2e3436") (background-mode . dark) (border-color . "#888a85") (cursor-color . "#eeeeec") (foreground-color . "#eeeeec") (mouse-color . "#eeeeec")) ((help-highlight-face . underline) (ibuffer-dired-buffer-face . font-lock-function-name-face) (ibuffer-help-buffer-face . font-lock-comment-face) (ibuffer-hidden-buffer-face . font-lock-warning-face) (ibuffer-occur-match-face . font-lock-warning-face) (ibuffer-read-only-buffer-face . font-lock-type-face) (ibuffer-special-buffer-face . font-lock-keyword-face) (ibuffer-title-face . font-lock-type-face)) (border ((t (:background "#888a85")))) (fringe ((t (:background "grey10")))) (mode-line ((t (:foreground "#eeeeec" :background "#555753")))) (region ((t (:background "#555753")))) (font-lock-builtin-face ((t (:foreground "#729fcf")))) (font-lock-comment-face ((t (:foreground "#888a85")))) (font-lock-constant-face ((t (:foreground "#8ae234")))) (font-lock-doc-face ((t (:foreground "#888a85")))) (font-lock-keyword-face ((t (:foreground "#729fcf" :bold t)))) (font-lock-string-face ((t (:foreground "#ad7fa8" :italic t)))) (font-lock-type-face ((t (:foreground "#8ae234" :bold t)))) (font-lock-variable-name-face ((t (:foreground "#eeeeec")))) (font-lock-warning-face ((t (:bold t :foreground "#f57900")))) (font-lock-function-name-face ((t (:foreground "#edd400" :bold t :italic t)))) (comint-highlight-input ((t (:italic t :bold t)))) (comint-highlight-prompt ((t (:foreground "#8ae234")))) (isearch ((t (:background "#f57900" :foreground "#2e3436")))) (isearch-lazy-highlight-face ((t (:foreground "#2e3436" :background "#e9b96e")))) (show-paren-match-face ((t (:foreground "#2e3436" :background "#73d216")))) (show-paren-mismatch-face ((t (:background "#ad7fa8" :foreground "#2e3436")))) (minibuffer-prompt ((t (:foreground "#729fcf" :bold t)))) (info-xref ((t (:foreground "#729fcf")))) (info-xref-visited ((t (:foreground "#ad7fa8")))) ))) (provide 'color-theme-tango) ;; use it (if window-system (color-theme-tango)) ;; Paren experiment (setq skeleton-pair t) (defvar my-skeleton-pair-alist '((?\) . ?\() (?\] . ?\[) (?} . ?{) (?" . ?") (?' . ?'))) (defun my-skeleton-pair-end (arg) "Skip the char if it is an ending, otherwise insert it." (interactive "*p") (let ((char last-command-char)) (if (and (assq char my-skeleton-pair-alist) (eq char (following-char))) (forward-char) (self-insert-command (prefix-numeric-value arg))))) (dolist (pair my-skeleton-pair-alist) (global-set-key (char-to-string (first pair)) 'my-skeleton-pair-end) ;; If the char for begin and end is the same, use the original skeleton (global-set-key (char-to-string (rest pair)) 'skeleton-pair-insert-maybe)) (defadvice backward-delete-char-untabify (before my-skeleton-backspace activate) "When deleting the beginning of a pair, and the ending is next char, delete it too." (let ((pair (assq (following-char) my-skeleton-pair-alist))) (and pair (eq (preceding-char) (rest pair)) (delete-char 1)))) (require 'timeclock-x) (timeclock-modeline-display 1) ;; if you want modline display (timeclock-initialize) (require 'timeclock-setup)