;; -*- emacs-lisp -*- ;; Author: Olivier Tetard ;; URL : http://toutoune25.miskin.fr/ ;; This file is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by the ;; Free Software Foundation; either version 2, or (at your option) any ;; later version. ;; This file is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the Free ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ;; 02111-1307, USA. ;; Inspiré par les fichiers de : ;; * Julien Danjou (julien.danjou.org) ;; * Mark Triggs (http://grapevine.net.au/) ;; ,---- ;; | Extensions et paths ;; `---- (push (expand-file-name "~/.elisp") load-path) (require 'color-theme) (require 'ido) ;; ,---- ;; | Couleurs et apparence ;; `---- (if window-system (color-theme-resolve) (color-theme-dark-laptop)) (set-face-background 'default "black") (if window-system (progn (tool-bar-mode nil) (tooltip-mode nil) (scroll-bar-mode t))) ;; Plus de couleurs pour font-lock-mode (inutile avec Emacs22) (setq font-lock-mode-maximum-decoration t) (setq font-lock-use-default-fonts t) (setq font-lock-use-default-colors t) (setq transient-mark-mode 't) ;; Active la coloration syntaxique par defaut (inutile avec Emacs22) (if (fboundp 'global-font-lock-mode) (global-font-lock-mode t)) ;; ,---- ;; | Comportement ;; `---- (ido-mode t) ; Utilisation du mode ido (setq auto-save-interval 1200) ; Autosave (setq scroll-step 2) ; On se decale de 2 lignes quand on change de page (delete-selection-mode t) ; On peut supprimer une selection (fset 'yes-or-no-p 'y-or-n-p) ; yes == y (show-paren-mode t) ; On affiche les parentheses liées (setq display-time-24hr-format t) ; Heure au format 24h (display-time) ; On affiche l'heure dans la barre (setq visible-bell t) ; On desactive les beeps ;; Quand vous recevez un fichier .txt d'une machine dos/windows il est ;; très énervant de voir les ^M a chaque fin de ligne, utiliser M-x ;; dos-unix pour vous en débarrasser. (J. Danjou) (defun dos-unix () (interactive) (goto-char (point-min)) (while (search-forward "\r" nil t) (replace-match ""))) ;; Ouverture des fichiers compresses (J. Danjou) (inutile avec Emacs22) (autoload 'jka-compr-installed-p "jka-compr") (if (not (jka-compr-installed-p)) (auto-compression-mode)) ;; Auto fill mode (set default-major-mode 'text-mode) (add-hook 'text-mode-hook 'turn-on-auto-fill) ;; On utilise Mozilla Firefox (defun browse-url-firefox-new-tab (url &optional new-window) "Open URL in a new tab in Firefox." ;; (interactive (browse-url-interactive-arg "URL: ")) (let ((cmd (shell-command-to-string (concat "mozilla-firefox -a firefox -remote 'openURL(" url ",new-tab)' > /dev/null")))) (unless (string= "" cmd) (message "Starting Firefox...") (start-process (concat "firefox " url) nil "/bin/sh" "-c" (concat "mozilla-firefox " url "|| true")) (message "Starting Firefox...done")))) (setq browse-url-browser-function 'browse-url-firefox-new-tab) ;; ,-------------- ;; | Les racourcis ;; `-------------- (global-set-key "\C-cg" 'goto-line) ; Avec Emacs22, M-g g fait la même chose (global-set-key "\C-cp" 'ps-print-buffer-with-faces) ;; ,---- ;; | Configuration pour les différants modes ;; `---- ;; Ispell/Aspell (setq ispell-program-name "aspell") (setq ispell-dictionary "french") ;; Pour JDE (Bug dans la sid) (setq global-senator-minor-mode t) ;; Pour TEX (setq tex-dvi-view-command "evince") (setq LaTeX-verbatim-environments (quote ("verbatim" "verbatim*" "lstlisting"))) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ;; Pour dired (setq find-file-run-dired t) (setq dired-listing-switches "-l") (setq dired-recursive-deletes 'top) ;; Pour perl-mode (defalias 'perl-mode 'cperl-mode) ;; Indentation (setq-default indent-tabs-mode nil) ;; Toujours avoir nouvelle ligne en fin de fichier (setq require-final-newline t)