Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Fichero de configuración
- ;; luispa's $HOME/.emacs
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;; Opciones genéricas.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;
- (setq frame-title-format "%b - GNU Emacs") ; Hacer el Frame un poco más útil
- (display-time) ; Mostrar la hora en modeline
- (setq default-major-mode 'text-mode) ; Al menos este modo no hará nada raro
- (setq pop-up-windows nil ; No cambiar mi windowconfiguration.
- european-calendar-style t ; Usar formato de fecha europeo
- require-final-newline t) ;
- ;; Edición inteligente
- (setq-default indent-tabs-mode nil)
- (global-set-key "\C-m" 'newline-and-indent)
- ;; Configurar el locale UTF-8
- (setq locale-coding-system 'utf-8)
- (set-terminal-coding-system 'utf-8)
- (set-keyboard-coding-system 'utf-8)
- (set-selection-coding-system 'utf-8)
- (prefer-coding-system 'utf-8)
- ;; Defino los colores con los que voy a trabajar
- (set-cursor-color "red")
- (set-mouse-color "green")
- (set-border-color "light green")
- ;; Ignoro mayúsculas/minúsculas en las búsquedas
- (setq case-fold-search t)
- ;; Configuración del ratón
- (set-mouse-color "blue")
- (mouse-wheel-mode)
- (set-scroll-bar-mode 'right)
- (setq scroll-step 1)
- ;; No beeping
- (setq ring-bell-function 'ignore)
- ;; Sin mensaje inicial
- (setq inhibit-startup-message t)
- ;; Esconder el toolbar
- (tool-bar-mode nil)
- ;; Mostrar los paréntesis. Al poner el cursor en un
- ;; paréntesis, resalta el opuesto.
- (show-paren-mode t)
- ;; Sin menús, los usuarios verdaderos de emacs no lo necesitan ;-)
- (menu-bar-mode nil)
- ;; Reabrir todos los burffers antiguos. Para inicializarlo
- ;; M-x desktop-save to ~/ sólo una vez, la siguiente lo recuerda.
- (desktop-load-default)
- (desktop-read)
- ;; Permito trabajar con ficheros comprimidos diréctamente
- ;; Soporta: gzip (.gz), bzip2 (.bz2) o compress (.Z). Tiene que
- ;; terminar con una de esas extensiones para reconocerlos.
- (auto-compression-mode t)
- ;; Usar la combinación "shift-cursor" para marcar
- (require 's-region)
- ;; Lenguaje
- ;(set-language-environment "Spanish")
- ; Variables especiales
- (custom-set-variables
- '(global-font-lock-mode t nil (font-lock))
- '(save-place t nil (saveplace))
- '(transient-mark-mode t))
- ;; Colorines
- (custom-set-faces
- '(font-lock-comment-face ((t (:foreground "forest green"))))
- '(highlight ((t (:foreground "blue" :background "indian red"))))
- '(isearch ((t (:inherit region))))
- '(modeline ((t (:foreground "black" :background "steelblue"))))
- '(region ((t (:foreground "white" :background "midnight blue"))))
- '(show-paren-match-face ((t (:foreground "black"
- :background "steel blue")))))
- ;; Teclas: Si usas o has usado windows estas teclas te ayudarán
- ;; a no volverte loco.
- (global-set-key [end] 'end-of-line)
- (global-set-key [home] 'beginning-of-line)
- (global-set-key [delete] 'delete-char)
- (global-set-key [C-home] 'beginning-of-buffer)
- (global-set-key [C-end] 'end-of-buffer)
- (global-set-key [?\C-z] 'undo)
- (global-set-key [M-f4] 'delete-frame)
- ;;; Mac OS X: Cmd-up/down para paging. En estudio
- (global-set-key [M-down] 'scroll-up)
- (global-set-key [M-up] 'scroll-down)
- ;; Backups. Normalmente el Emacs crea backups y dejar ficheros que
- ;; terminan con ~ por todas partes. Con lo siguiente centralizo
- ;; todos los ficheros de backup en $HOME/.backups o en C:\TMP\Backup
- ;; si estás en windows (hay que crear los directorios de backup)
- (setq make-backup-files t)
- (setq auto-save-default nil)
- (setq delete-old-versions t)
- (defun make-backup-file-name (file)
- (require 'dired)
- (let (path)
- (cond ((eq system-type 'windows-nt)
- (setq file (dired-replace-in-string ":" "" file))
- (setq path "C:/TMP/Backup/"))
- (t
- (setq path "~/.backups/")))
- (concat path
- (dired-replace-in-string "/" "~" file)
- (format-time-string "~%Y%m%d%H%M%S~")
- (car (last (split-string file "/"))))))
- ;; Recordará los últimos 100 ficheros visitados, los
- ;; últimos 50 comandos usados en la shell o las últimas 20
- ;; expresiones regulares usadas.
- (when (fboundp 'desktop-load-default)
- (desktop-load-default)
- (mapcar
- (lambda (sym) (add-to-list 'desktop-globals-to-save sym))
- '((buffer-name-history . 20)
- (dired-regexp-history . 20)
- (extended-command-history . 30)
- (file-name-history . 100)
- (grep-history . 30)
- (minibuffer-history . 50)
- (query-replace-history . 60)
- (read-expression-history . 60)
- (regexp-history . 60)
- (regexp-search-ring . 20)
- (search-ring . 20)
- (shell-command-history . 50)))
- (desktop-read))
- ;; Fin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement