;;------------------------------------------------------------------------------ (setq initial-frame-alist '((top . 0) (left . 0) (width . 80) (height . 100))) ;Make it open allways in the same place (setq transient-mark-mode t) ; Make the region visible (setq highlight-nonselected-windows t) (setq inhibit-startup-message t) ; No startup message (setq default-fill-column 72) ; Text width (depends on mode!) (setq require-final-newline nil) ; do NOT require newline at EOF (define-key global-map [delete] 'delete-char) ; del as del! (setq lpr-add-switches nil ) ; remove all switches ;;(menu-bar-mode nil) ; no menu (toggle on with F10, see below) ;;(scroll-bar-mode nil) ; do not show the scroll bar (setq-default ispell-program-name "aspell") ; aspell instead of ispell (setq ispell-dictionary "american") ; american english (set-default 'ispell-local-dictionary "american") (column-number-mode 1) ; show column numbers (setq set-message-beep nil) ; surpress the emacs beep (setq scroll-preserve-screen-position 1) ; Pgup/dn will return exactly to the starting point. (setq-default indent-tabs-mode nil) ; inserts spaces instead of tabs (setq-default c-basic-offset 4) ;;------------------------------------------------------------------------------------------------ ;; set F* keys with usefull shortcuts (global-set-key [f2] 'just-one-space) ; reduces inter-word space to just one whitespace (global-set-key [f3] 'imenu) ; activate index-menu (global-set-key [f4] 'find-file) ; open buffer (global-set-key [f5] 'goto-line) ; guess what (global-set-key [f9] 'revert-buffer) ; re-read from disc (global-set-key [f10] 'menu-bar-mode) ; toggle the menu-bar on/off (global-set-key [(control tab)] 'complete-tag) ; complete a tag ;;------------------------------------------------------------------------------------------------ ;; word count (defun word-count nil "Count words in buffer" (interactive) (shell-command-on-region (point-min) (point-max) "wc -w")) ;;------------------------------------------------------------------------------------------------ ;; Mousewheel (defun sd-mousewheel-scroll-up (event) "Scroll window under mouse up by five lines." (interactive "e") (let ((current-window (selected-window))) (unwind-protect (progn (select-window (posn-window (event-start event))) (scroll-up 5)) (select-window current-window)))) (defun sd-mousewheel-scroll-down (event) "Scroll window under mouse down by five lines." (interactive "e") (let ((current-window (selected-window))) (unwind-protect (progn (select-window (posn-window (event-start event))) (scroll-down 5)) (select-window current-window)))) (global-set-key (kbd "") 'sd-mousewheel-scroll-up) (global-set-key (kbd "") 'sd-mousewheel-scroll-down) ;;------------------------------------------------------------------------------------------------ ;; Customizations for c++-mode ;;(defun my-c++-mode-hook () ;; (setq tab-width 4) ;; (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent) ;; (define-key c++-mode-map "\C-ce" 'c-comment-edit) ;; (setq c++-auto-hungry-initial-state 'none) ;; (setq c++-delete-function 'backward-delete-char) ;; (setq c++-tab-always-indent t) ;; (setq c-indent-level 4) ;; (setq c-continued-statement-offset 4) ;; (setq c++-empty-arglist-indent 4)) ;;(add-hook 'c++-mode-hook 'my-c++-mode-hook) ;;------------------------------------------------------------------------------------------------ ;; make ispell ignore the arguments of some more latex commands (setq ispell-tex-skip-alists (list (append (car ispell-tex-skip-alists) ;tell ispell to ignore content of this: '(("\\\\cite" ispell-tex-arg-end) ("\\\\nocite" ispell-tex-arg-end) ("\\\\includegraphics" ispell-tex-arg-end) ("\\\\bibliography" ispell-tex-arg-end) ("\\\\ref" ispell-tex-arg-end) ("\\\\eqref" ispell-tex-arg-end) ("\\\\overpic" ispell-tex-arg-end) ("\\\\label" ispell-tex-arg-end))) (cadr ispell-tex-skip-alists))) ;;------------------------------------------------------------------------------------------------ ;; open *.tpl files per default in C++-mode (setq auto-mode-alist (cons '("\\.tpl\\'" . c++-mode) auto-mode-alist)) (setq auto-mode-alist (cons '("\\.ipp\\'" . c++-mode) auto-mode-alist)) ;;------------------------------------------------------------------------------------------------ ;;C++-something ?? (add-hook 'c++-mode-hook (function (lambda () (imenu-add-menubar-index)))) ;;------------------------------------------------------------------------------------------------ ;;activate AUCtex (require 'tex-site) (setq TeX-auto-save t) (setq TeX-parse-self t) (setq-default TeX-master nil) ;Query for master file (add-hook 'LaTeX-mode-hook 'turn-on-auto-fill) ;;------------------------------------------------------------------------------------------------ ;;reftex (add-hook 'latex-mode-hook 'turn-on-reftex) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-auctex t) (setq reftex-label-alist '(AMSTeX)) ;; flyspell (add-hook 'LaTeX-mode-hook 'flyspell-mode) (defun my-LaTeX-mode-hook () ;; rebind TeX-complete-symbol to M-] (local-set-key "\M-]" 'TeX-complete-symbol) ;; insert a pair of braces ;;(local-set-key "{" 'TeX-insert-braces) ) (add-hook 'LaTeX-mode-hook 'my-LaTeX-mode-hook) (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. '(c-default-style "gnu") '(case-fold-search t) '(current-language-environment "Latin-1") '(default-input-method "latin-1-prefix") '(ecb-options-version "2.27") '(face-font-family-alternatives (quote (("courier" "fixed") ("helv" "helvetica" "arial" "fixed") ("misc" "fixed")))) '(global-font-lock-mode t nil (font-lock)) '(load-home-init-file t t) '(ps-black-white-faces (quote ((font-lock-builtin-face "black" nil bold) (font-lock-comment-face "Firebrick" nil italic) (font-lock-constant-face "black" nil bold) (font-lock-function-name-face "black" nil bold) (font-lock-keyword-face "black" nil bold) (font-lock-string-face "black" nil italic) (font-lock-type-face "black" nil italic) (font-lock-variable-name-face "black" nil bold italic) (font-lock-warning-face "black" nil bold italic)))) '(ps-default-fg (quote (0.0 0.0 0.0))) '(ps-print-color-p t) '(query-user-mail-address nil) '(safe-local-variable-values (quote ((TeX-master . "main") (TeX-master . t)))) '(show-paren-mode t nil (paren)) '(tab-width 2)) ;;----------------------------------------------------------------------- (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 (:stipple nil :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal)))) '(button ((((supports :underline t)) (:background "indian red" :underline t)))) '(cursor ((t (:background "cyan")))) '(delete-char [4]) '(font-latex-bold-face ((((class color) (background dark)) (:inherit bold :foreground "medium blue")))) '(font-latex-italic-face ((((class color) (background dark)) (:inherit italic :foreground "medium blue")))) '(fringe ((t (:background "black")))) '(header-line ((((class color grayscale) (background light)) (:inherit mode-line :background "black" :foreground "green3" :box nil)))) '(menu ((((type x-toolkit)) (:background "black" :foreground "green3")))) '(mode-line ((((type x w32 mac) (class color)) (:background "black" :foreground "green3" :box (:line-width -1 :style released-button))))) '(mode-line-inactive ((default (:inherit mode-line)) (((class color) (min-colors 88) (background dark)) (:background "black" :foreground "grey80" :box (:line-width -1 :color "black") :weight light)))) '(mouse ((t (:background "#000000")))) '(region ((nil (:inverse-video t)))) '(scroll-bar ((t (:background "dark grey")))) '(tool-bar ((((type x w32 mac) (class color)) (:background "black" :foreground "green3" :box (:line-width 1 :style released-button))))))