My emacs config file (scrot, raw, dl)
Imposcillator Jul 26, 2011 (emacs/config)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | ;;; 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 "<C-right>") 'enlarge-window-horizontally)
(global-set-key (kbd "<C-left>") '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")))))
|
x
Notes
Just sharing my emacs configuration file. I am by all means an emacs newbie but you might find something you hadn’t thought about or might like to try out. I tried to keep it as clean as possible and left out all functions that would only be of use for me.