;; customize a few things (custom-set-variables '(tex-dvi-view-command "kdvi" t) '(transient-mark-mode t) '(tab-width 4) '(dabbrev-upcase-means-case-search t) '(line-number-mode t) '(sgml-indent-data t) '(column-number-mode t) '(global-font-lock-mode t nil (font-lock)) '(make-backup-files nil)) ;; map often used commands (global-set-key [f7] 'next-error) (global-set-key [f8] 'compile) (global-set-key [f9] 'recompile) ;; quick jump to line (global-set-key "\C-cl" 'goto-line) ;; behave like KDE (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) (global-set-key [delete] 'delete-char) ;; auto wrap everything (setq fill-column 79) (setq default-major-mode 'text-mode) (setq text-mode-hook 'turn-on-auto-fill) ;; enable tab completion (global-set-key [S-iso-lefttab] 'dabbrev-expand) ;(global-set-key [S-tab] 'dabbrev-expand) (add-hook 'ada-mode-hook '(lambda () "anonymous function to enable dabbrev-expand in ada-mode" (local-set-key [S-tab] 'dabbrev-expand))) ;; set default dictionary to german (setq ispell-dictionary "german-new8") ;; convenient shortcut (fset 'yes-or-no-p 'y-or-n-p) ;; from http://www.jwz.org/doc/tabs-vs-spaces.html (defun untabify-buffer () (save-excursion (goto-char (point-min)) (while (re-search-forward "[ \t]+$" nil t) (delete-region (match-beginning 0) (match-end 0))) (goto-char (point-min)) (if (search-forward "\t" nil t) (untabify (1- (point)) (point-max)))) nil) (add-hook 'c-mode-hook '(lambda () (local-set-key [C-o] 'ff-get-other-file) (set-variable 'c-basic-offset 2) (set-variable 'tab-width 8) (make-local-variable 'write-contents-hooks) (add-hook 'write-contents-hooks 'untabify-buffer))) (add-hook 'c++-mode-hook '(lambda () (local-set-key [C-o] 'ff-get-other-file) (set-variable 'c-basic-offset 2) (set-variable 'tab-width 8) (make-local-variable 'write-contents-hooks) (add-hook 'write-contents-hooks 'untabify-buffer))) ;; fast buffer switching (require 'iswitchb) (iswitchb-default-keybindings) ;; syntax highlighting for SGML mode (add-hook 'sgml-mode-hook '(lambda () (set-variable 'sgml-indent-data t) (set-variable 'sgml-set-face t))) ;; Emacs 21 stuff ;; install misc-fixed as default font again (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. '(default ((t (:stipple nil :background "#ffffff" :foreground "#000000" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 123 :width normal :family "misc-fixed"))))) ;; turn off toolbar (tool-bar-mode 0)