;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; In this .emacs file, the following keybindings ; are changed or introduced ; ; F2 - current date ; F3 - current time ; F4 - current date and time ; ; F5 - compile ; ; F9 - spell buffer ; F11 ; F12 - spell word ; ; - beginning of line of first non-space ; - end of line ; Ctrl- - beginning of buffer ; Ctrl- - end of buffer ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; No emacs start-up message (setq inhibit-startup-message t) ;; Set time format (setq display-time-format "%H:%M%p") ;; Hide the toolbar (tool-bar-mode nil) ;; Show marked text (transient-mark-mode t) ;; Math parentheses (show-paren-mode t) ;; Show column number in info area (column-number-mode t) ;; Colorize tokens (global-font-lock-mode t) ;; No more backup files (~) (setq make-backup-files nil) ;; White on Black (set-background-color "black") (set-foreground-color "white") (set-mouse-color "white") (set-cursor-color "white") ;; Start size (set-frame-size (selected-frame) 81 60) ;; Easy compilation (global-set-key [f7] 'compile) ;; Scroll on wheel of mouses (defun up-slightly () (interactive) (scroll-up 5)) (defun down-slightly () (interactive) (scroll-down 5)) (global-set-key [mouse-4] 'down-slightly) (global-set-key [mouse-5] 'up-slightly) (defun up-one () (interactive) (scroll-up 1)) (defun down-one () (interactive) (scroll-down 1)) (global-set-key [S-mouse-4] 'down-one) (global-set-key [S-mouse-5] 'up-one) (defun up-a-lot () (interactive) (scroll-up)) (defun down-a-lot () (interactive) (scroll-down)) (global-set-key [C-mouse-4] 'down-a-lot) (global-set-key [C-mouse-5] 'up-a-lot) (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-1") '(default-input-method "latin-1-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. ) ;; Make sure file always ends with a newline. (setq require-final-newline t) ;; Set Delete work as it should ;; (global-set-key (kbd "") 'delete-char) (global-set-key [backspace] 'backward-delete-char) (global-set-key [delete] 'delete-char) ;; Default auto-fill (setq text-mode-hook '(lambda() (auto-fill-mode 1))) ;; Automatic opening of zipped files. (auto-compression-mode 1) ;; Let's normalize "home" and "end" (global-set-key [home] 'beginning-of-line) (global-set-key [end] 'end-of-line) (global-set-key [C-home] 'beginning-of-buffer) (global-set-key [C-end] 'end-of-buffer) ;; Insert the date, the time, and the date and time at point. (defvar insert-time-format "%T" "*Format for \\[insert-time] (c.f. 'format-time-string' for how to format).") (defvar insert-date-format "%Y/%m/%d" "*Format for \\[insert-date] (c.f. 'format-time-string' for how to format).") (defun insert-time () "Insert the current time according to the variable \"insert-time-format\"." (interactive "*") (insert (format-time-string insert-time-format (current-time)))) (defun insert-date () "Insert the current date according to the variable \"insert-date-format\"." (interactive "*") (insert (format-time-string insert-date-format (current-time)))) (defun insert-time-and-date () "Insert the current date according to the variable \"insert-date-format\", then a space, then the current time according to the variable \"insert-time-format\"." (interactive "*") (progn (insert-date) (insert " ") (insert-time))) (global-set-key [f2] 'insert-date) (global-set-key [f3] 'insert-time) (global-set-key [f4] 'insert-time-and-date) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (global-set-key [f9] 'ispell-buffer) (global-set-key [f12] 'ispell-complete-word) ; Sets the height of the compilation window to 25% of the total ; instead of default 50% (setq compilation-window-height 15) ;; Here`s the default value of auto-insert-alist: ;;(defvar auto-insert-alist `(("\.tex$" . "tex-insert.tex") ;; ("\.c$" . "c-insert.c") ;; ("\.h$" . "h-insert.c") ;; ("[Mm]akefile" . "makefile.inc") ;; ("\.bib$" . "tex-insert.tex")) ;;(setq auto-insert-alist ;; (nconc `(("\.el$" . "elisp-insert.el") ;; ("\.ms$" . "roff-insert.ms") ;; ("\.csh$" . "csh-insert.csh") ;; ("\.sh$" . "csh-insert.sh")) ;; auto-insert-alist))