diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-13 06:25:15 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-13 06:25:15 +0100 |
commit | d573b7413e267aae0c32e083cec45d583ccf0562 (patch) | |
tree | 21210212934a70bdb84ebe2f6ca8fa7a0e6203d7 /emacs | |
parent | f19dd70ece015509d52d0e9a7c113ccccad96e0e (diff) | |
download | dotfiles-d573b7413e267aae0c32e083cec45d583ccf0562.tar.gz dotfiles-d573b7413e267aae0c32e083cec45d583ccf0562.tar.xz dotfiles-d573b7413e267aae0c32e083cec45d583ccf0562.zip |
heavy update of emacs configs
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs | 155 |
1 files changed, 104 insertions, 51 deletions
@@ -5,6 +5,8 @@ ;; If there is more than one, they won't work right. '(Buffer-menu-use-frame-buffer-list nil) '(abbrev-mode t) + '(ac-dwim t) + '(ac-modes (quote (emacs-lisp-mode lisp-interaction-mode c-mode cc-mode c++-mode java-mode perl-mode cperl-mode python-mode ruby-mode ecmascript-mode javascript-mode js2-mode php-mode css-mode makefile-mode sh-mode fortran-mode f90-mode ada-mode xml-mode sgml-mode delphi-mode))) '(all-christian-calendar-holidays t) '(auto-compression-mode t nil (jka-compr)) '(auto-insert-mode t) @@ -24,6 +26,8 @@ '(column-number-mode t) '(compilation-skip-threshold 2) '(confirm-kill-emacs (quote y-or-n-p)) + '(curchg-default-cursor-color "white") + '(curchg-overwrite/read-only-cursor-type (quote hollow)) '(current-language-environment "English") '(delphi-case-label-indent 2) '(delphi-indent-level 2) @@ -51,11 +55,19 @@ '(ecb-tag-display-function (quote ((default . ecb--semantic-format-tag-uml-prototype)))) '(ecb-tip-of-the-day nil) '(ecb-use-speedbar-instead-native-tree-buffer nil) + '(etags-table-search-up-depth 10) '(fill-individual-varying-indent t) + '(flyspell-default-dictionary "english") + '(flyspell-delay 1) + '(flyspell-duplicate-distance -1) + '(flyspell-issue-message-flag nil) + '(flyspell-mark-duplications-flag nil) + '(flyspell-use-meta-tab t) '(focus-follows-mouse t) '(font-lock-support-mode (quote jit-lock-mode)) '(frame-background-mode nil) '(fringe-mode nil nil (fringe)) + '(global-auto-complete-mode t) '(global-font-lock-mode t nil (font-lock)) '(global-hl-line-mode t nil (hl-line)) '(gnus-audio-au-player "/usr/bin/aplay") @@ -69,6 +81,10 @@ '(inhibit-eol-conversion nil) '(inhibit-startup-screen t) '(inverse-video nil) + '(ispell-extra-args nil) + '(ispell-program-name "/usr/bin/ispell") + '(ispell-silently-savep t) + '(ispell-use-framepop-p t) '(jde-run-option-application-args (quote ("10"))) '(jit-lock-chunk-size 1024) '(jit-lock-context-time 0.1) @@ -93,9 +109,16 @@ '(savehist-mode t nil (savehist)) '(scalable-fonts-allowed t) '(scroll-bar-mode (quote right)) + '(scroll-conservatively 0) + '(scroll-down-aggressively nil) + '(scroll-margin 0) + '(scroll-preserve-screen-position t) + '(scroll-step 0) + '(scroll-up-aggressively nil) '(server-mode t) '(show-trailing-whitespace t) '(sieve-manage-default-user "alexander@sulfrian.net") + '(smooth-scroll-margin 2) '(speedbar-directory-button-trim-method (quote trim)) '(speedbar-frame-parameters (quote ((minibuffer) (width . 30) (height . 60) (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) (unsplittable . t) (left-fringe . 0)))) '(speedbar-frame-plist (quote (minibuffer nil width 30 height 60 border-width 0 internal-border-width 0 unsplittable t default-toolbar-visible-p nil has-modeline-p nil menubar-visible-p nil default-gutter-visible-p nil))) @@ -205,9 +228,6 @@ (setq fill-column 72) (setq semanticdb-default-save-directory "~/.emacs.d/semantic") -(setq ispell-extra-args '("-Tlatin15" - "-d" "/usr/lib/ispell/german" - "-w" "äöüÄÖÜß")) (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8) @@ -216,7 +236,6 @@ (prefer-coding-system 'utf-8) ; load-path anpassen -(setq load-path (cons "/usr/share/maxima/5.9.0/emacs" load-path)) (let* ((my-lisp-dir "~/.emacs.d/lisp") (default-directory my-lisp-dir) (orig-load-path load-path)) @@ -224,21 +243,10 @@ (normal-top-level-add-subdirs-to-load-path) (nconc load-path orig-load-path)) - -(autoload 'maxima-mode "maxima" "Maxima mode" t) -(autoload 'maxima "maxima" "Maxima interactive" t) -(setq auto-mode-alist (cons '("\.max" . maxima-mode) auto-mode-alist)) -(autoload 'emaxima-mode "emaxima" "EMaxima" t) -(add-hook 'emaxima-mode-hook 'emaxima-mark-file-as-emaxima) - (setq auto-mode-alist (cons '("README" . text-mode) auto-mode-alist)) -(setq auto-mode-alist (cons '("\\.pas" . delphi-mode) auto-mode-alist)) (setq compilation-scroll-output t) -(require 'compile) -(pushnew '("^\\([-a-zA-Z0-9\\.\\/_~]+\\)(\\([0-9]+\\),\\([0-9]+\\))\s\\([Ff]atal:\\|[Nn]ote:\\|[Ww]arning:\\|[Ee]rror:\\)\s\\(.*$\\)" 1 2 3) - compilation-error-regexp-alist) - +; css-mode (setq cssm-indent-level 4) (setq cssm-newline-before-closing-bracket t) (setq cssm-indent-function #'cssm-c-style-indenter) @@ -277,37 +285,68 @@ (c-set-style "linux") ; set indentation style )) -(global-set-key [C-return] 'dabbrev-expand) -(define-key esc-map [C-return] 'dabbrev-completion) +(global-set-key [C-return] 'dabbrev-expand) +(define-key esc-map [C-return] 'dabbrev-completion) (global-set-key [f12] 'indent-region) -; Ctrl(+Shift)+Tab to (un)indent a line with a full tab -(defun indent-region-with-tab () - (interactive) - (save-excursion - (if (< (point) (mark)) (exchange-point-and-mark)) - (let ((save-mark (mark))) - (if (= (point) (line-beginning-position)) (previous-line 1)) - (goto-char (line-beginning-position)) - (while (>= (point) save-mark) - (goto-char (line-beginning-position)) - (insert "\t") - (previous-line 1))))) -(global-set-key [M-tab] 'indent-region-with-tab) - -(defun unindent-region-with-tab () +;; Enable Doxygen syntax highlighting for C and C++ +(require 'doxymacs) +(add-hook 'font-lock-mode-hook + '(lambda () + (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode)) + (doxymacs-font-lock)))) + +;; flyspell +(add-hook 'c-mode-hook 'flyspell-prog-mode) +(add-hook 'sh-mode-hook 'flyspell-prog-mode) +(add-hook 'c++-mode-hook 'flyspell-prog-mode) +(add-hook 'ruby-mode-hook 'flyspell-prog-mode) +(add-hook 'cperl-mode-hook 'flyspell-prog-mode) +(add-hook 'python-mode-hook 'flyspell-prog-mode) +(add-hook 'autoconf-mode-hook 'flyspell-prog-mode) +(add-hook 'autotest-mode-hook 'flyspell-prog-mode) +(add-hook 'makefile-mode-hook 'flyspell-prog-mode) +(add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode) + +(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex)))) +(add-hook 'texinfo-mode + '(lambda () (setq flyspell-generic-check-word-p + 'texinfo-mode-flyspell-verify))) + +(add-hook 'text-mode-hook (lambda () (flyspell-mode 1))) +(add-hook 'change-log-mode-hook (lambda () (flyspell-mode 1))) + +(add-hook 'flyspell-mode-hook 'flyspell-buffer) + +; ignore all #include stings +(add-hook 'flyspell-incorrect-hook + (lambda (left right undef) + (save-excursion + (goto-char left) + (beginning-of-line) + (if (looking-at "#include") + 't + 'nil) + ))) + +; change dictionary +(defun switch-dictionary() (interactive) - (save-excursion - (if (< (point) (mark)) (exchange-point-and-mark)) - (let ((save-mark (mark))) - (if (= (point) (line-beginning-position)) (previous-line 1)) - (goto-char (line-beginning-position)) - (while (>= (point) save-mark) - (goto-char (line-beginning-position)) - (if (= (string-to-char "\t") (char-after (point))) (delete-char 1)) - (previous-line 1))))) -(global-set-key [M-S-iso-lefttab] 'unindent-region-with-tab) + (let* ((dic ispell-current-dictionary) + (change (if (string= dic "german") "english" "german"))) + (ispell-change-dictionary change) + (message "Dictionary switched from %s to %s" dic change) + (if flyspell-mode (save-excursion (flyspell-buffer))))) +(global-set-key (kbd "<f8>") 'switch-dictionary) + +; update flyspell after changing dictionary +(defadvice ispell (after advice) + (flyspell-buffer)) +(ad-activate 'ispell t) +(defadvice ispell-word (after advice) + (flyspell-buffer)) +(ad-activate 'ispell-word t) ; byte-compile .emacs (defun autocompile nil @@ -328,7 +367,7 @@ (setq-default save-place t) (require 'saveplace) -; clever autocomplete mode +; clever auto complete mode (require 'ido) (ido-mode t) (setq @@ -340,19 +379,19 @@ ido-max-prospects 6 ido-confirm-unique-completion t) -; servermode (to edit files with emacsclient) +; server mode (to edit files with emacsclient) (server-start) ; emacs code browser (ecb-activate) -; smex +;; smex (setq smex-save-file "~/.emacs.d/smex.save") (require 'smex) (smex-initialize) (global-set-key (kbd "M-X") 'smex) -; snippets +;; snippets (require 'yasnippet) (yas/initialize) (yas/load-directory "~/.emacs.d/snippets") @@ -402,21 +441,35 @@ (load "rudel-loaddefs.el") -; magit +;; magit (require 'magit) -; linum (generic & *scratch*) +;; linum (generic & *scratch*) (add-hook 'find-file-hook (lambda () (linum-mode 1))) (add-hook 'lisp-interaction-mode-hook (lambda () (linum-mode 1))) -; bookmarks +;; bookmarks (setq bookmark-default-file "~/.emacs.d/bookmarks") (setq bookmark-save-flag 1) -; winring +;; winring (require 'winring) (ecb-winman-winring-enable-support) (winring-initialize) (global-set-key (kbd "C-x j") 'winring-jump-to-configuration) (global-set-key (kbd "C-x n") 'winring-new-configuration) (global-set-key (kbd "C-x K") 'winring-delete-configuration) + +;; etags +(require 'etags-table) + +; autocompletion for etags +(require 'auto-complete-etags) + +;; change cursor according to the mode (normal, read only, overwrite) +(require 'cursor-chg) +(toggle-cursor-type-when-idle 1) +(change-cursor-mode 1) + +;; windmove (only if available) +(when (fboundp 'windmove-default-keybindings) (windmove-default-keybindings)) |