;;; NOTE: This .emacs uses pre-installed packages. ;;; If you're on Linux, you'll need the emacs-goodies-el package ;;; as well as the auctex package. Additionally, you will need to download ;;; the zenburn color theme for emacs and place it in ~/emacstuff. ;;; PACKAGE LOADING ;; tell emacs where your package library is ;; this is the dir you have the something.el file (add-to-list 'load-path "~/") ;;; ------------------------------------------------------------------ ;;; FUNCTION AND LOOK PREFERENCES ;; no blinking cursor plox (blink-cursor-mode -1) ;; hide the menu bar (menu-bar-mode -1) ;; clipboard (cua-mode t) (setq cua-auto-tabify-rectangles nil) ;;don't tabify after rectangle commands (transient-mark-mode 1) ;;no region when it is not highlighted (setq cua-keep-region-after-copy t) ;;standard windows behavior ;; show matching parentheses (show-paren-mode t) ;; no splash screen (setq inhibit-splash-screen t) ;; disable toolbar (tool-bar-mode -1) ;; disable scrollbar (scroll-bar-mode -1) ;; turn off the annoying bell, have a flashing square (setq visible-bell t) ;; highlight the current line (global-hl-line-mode 1) ;; customize the background color (set-face-background 'hl-line "#222") ;; disable backup (setq backup-inhibited t) ;; disable auto save (setq auto-save-default nil) (put 'erase-buffer 'disabled nil) ;; drive out the mouse when it's too near to the cursor (mouse-avoidance-mode 'animate) ;; delete the selected region when something is typed or with DEL (delete-selection-mode 1) ;; Use control-arrow keys for window resizing (global-set-key (kbd "") 'enlarge-window-horizontally) (global-set-key (kbd "") 'shrink-window-horizontally) ;; load color theme essentials, turn to zenburn (add-to-list 'load-path "~/emacstuff") (require 'color-theme-zenburn) (color-theme-initialize) (color-theme-zenburn) ;; AUCTeX (require 'tex-site) (setq TeX-auto-save t) (setq TeX-parse-self t) ;; set xetex mode in tex/latex (add-hook 'LaTeX-mode-hook (lambda() (add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t)) (setq TeX-command-default "XeLaTeX") (setq TeX-save-query nil) (setq TeX-show-compilation t) )) ;; Fullscreen (defun toggle-fullscreen (&optional f) (interactive) (let ((current-value (frame-parameter nil 'fullscreen))) (set-frame-parameter nil 'fullscreen (if (equal 'fullboth current-value) (if (boundp 'old-fullscreen) old-fullscreen nil) (progn (setq old-fullscreen current-value) 'fullboth))))) (global-set-key [f11] 'toggle-fullscreen) ; Make new frames fullscreen by default. Note: this hook doesn't do ; anything to the initial frame if it's in your .emacs, since that file is ; read _after_ the initial frame is created. (add-hook 'after-make-frame-functions 'toggle-fullscreen) ;;; ------------------------------------------------------------------ ;;; CUSTOM FUNCTIONS ;; cwords - count words! (defun cwords (&optional begin end) "count words between BEGIN and END (region); if no region defined, count words in buffer" (interactive "r") (let ((b (if mark-active begin (point-min))) (e (if mark-active end (point-max)))) (message "Word count: %s" (how-many "\\w+" b e)))) ;; idate - insert date (defun idate () (interactive) (insert (format-time-string "%Y-%m-%d"))) ;; itime - insert time (defun itime () (interactive) (insert (format-time-string "%R"))) ;; edot - Edit the .emacs file (defun edot () (interactive) (find-file "~/.emacs")) ;; ldot - Load the .emacs file (to apply changes) (defun ldot () (interactive) (load-file "~/.emacs")) (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. '(blink-cursor-mode nil) '(show-paren-mode t)) (custom-set-faces ;; custom-set-faces 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. '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 145 :width normal :foundry "unknown" :family "Terminus")))))