Advertisement
Luispa

$HOME/.emacs

Oct 31st, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; Fichero de configuración
  3. ;; luispa's $HOME/.emacs
  4. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5.  
  6. ;;;; Opciones genéricas.
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9. (setq frame-title-format "%b - GNU Emacs") ; Hacer el Frame un poco más útil
  10. (display-time) ; Mostrar la hora en modeline
  11. (setq default-major-mode 'text-mode) ; Al menos este modo no hará nada raro
  12. (setq pop-up-windows nil ; No cambiar mi windowconfiguration.
  13. european-calendar-style t ; Usar formato de fecha europeo
  14. require-final-newline t) ;
  15.  
  16. ;; Edición inteligente
  17. (setq-default indent-tabs-mode nil)
  18. (global-set-key "\C-m" 'newline-and-indent)
  19.  
  20. ;; Configurar el locale UTF-8
  21. (setq locale-coding-system 'utf-8)
  22. (set-terminal-coding-system 'utf-8)
  23. (set-keyboard-coding-system 'utf-8)
  24. (set-selection-coding-system 'utf-8)
  25. (prefer-coding-system 'utf-8)
  26.  
  27. ;; Defino los colores con los que voy a trabajar
  28. (set-cursor-color "red")
  29. (set-mouse-color "green")
  30. (set-border-color "light green")
  31.  
  32. ;; Ignoro mayúsculas/minúsculas en las búsquedas
  33. (setq case-fold-search t)
  34.  
  35. ;; Configuración del ratón
  36. (set-mouse-color "blue")
  37. (mouse-wheel-mode)
  38. (set-scroll-bar-mode 'right)
  39. (setq scroll-step 1)
  40.  
  41. ;; No beeping
  42. (setq ring-bell-function 'ignore)
  43.  
  44. ;; Sin mensaje inicial
  45. (setq inhibit-startup-message t)
  46.  
  47. ;; Esconder el toolbar
  48. (tool-bar-mode nil)
  49.  
  50. ;; Mostrar los paréntesis. Al poner el cursor en un
  51. ;; paréntesis, resalta el opuesto.
  52. (show-paren-mode t)
  53.  
  54. ;; Sin menús, los usuarios verdaderos de emacs no lo necesitan ;-)
  55. (menu-bar-mode nil)
  56.  
  57. ;; Reabrir todos los burffers antiguos. Para inicializarlo
  58. ;; M-x desktop-save to ~/ sólo una vez, la siguiente lo recuerda.
  59. (desktop-load-default)
  60. (desktop-read)
  61.  
  62. ;; Permito trabajar con ficheros comprimidos diréctamente
  63. ;; Soporta: gzip (.gz), bzip2 (.bz2) o compress (.Z). Tiene que
  64. ;; terminar con una de esas extensiones para reconocerlos.
  65. (auto-compression-mode t)
  66.  
  67. ;; Usar la combinación "shift-cursor" para marcar
  68. (require 's-region)
  69.  
  70. ;; Lenguaje
  71. ;(set-language-environment "Spanish")
  72.  
  73. ; Variables especiales
  74. (custom-set-variables
  75. '(global-font-lock-mode t nil (font-lock))
  76. '(save-place t nil (saveplace))
  77. '(transient-mark-mode t))
  78.  
  79. ;; Colorines
  80. (custom-set-faces
  81. '(font-lock-comment-face ((t (:foreground "forest green"))))
  82. '(highlight ((t (:foreground "blue" :background "indian red"))))
  83. '(isearch ((t (:inherit region))))
  84. '(modeline ((t (:foreground "black" :background "steelblue"))))
  85. '(region ((t (:foreground "white" :background "midnight blue"))))
  86. '(show-paren-match-face ((t (:foreground "black"
  87. :background "steel blue")))))
  88.  
  89. ;; Teclas: Si usas o has usado windows estas teclas te ayudarán
  90. ;; a no volverte loco.
  91. (global-set-key [end] 'end-of-line)
  92. (global-set-key [home] 'beginning-of-line)
  93. (global-set-key [delete] 'delete-char)
  94. (global-set-key [C-home] 'beginning-of-buffer)
  95. (global-set-key [C-end] 'end-of-buffer)
  96. (global-set-key [?\C-z] 'undo)
  97. (global-set-key [M-f4] 'delete-frame)
  98.  
  99. ;;; Mac OS X: Cmd-up/down para paging. En estudio
  100. (global-set-key [M-down] 'scroll-up)
  101. (global-set-key [M-up] 'scroll-down)
  102.  
  103. ;; Backups. Normalmente el Emacs crea backups y dejar ficheros que
  104. ;; terminan con ~ por todas partes. Con lo siguiente centralizo
  105. ;; todos los ficheros de backup en $HOME/.backups o en C:\TMP\Backup
  106. ;; si estás en windows (hay que crear los directorios de backup)
  107. (setq make-backup-files t)
  108. (setq auto-save-default nil)
  109. (setq delete-old-versions t)
  110. (defun make-backup-file-name (file)
  111. (require 'dired)
  112. (let (path)
  113. (cond ((eq system-type 'windows-nt)
  114. (setq file (dired-replace-in-string ":" "" file))
  115. (setq path "C:/TMP/Backup/"))
  116. (t
  117. (setq path "~/.backups/")))
  118. (concat path
  119. (dired-replace-in-string "/" "~" file)
  120. (format-time-string "~%Y%m%d%H%M%S~")
  121. (car (last (split-string file "/"))))))
  122.  
  123. ;; Recordará los últimos 100 ficheros visitados, los
  124. ;; últimos 50 comandos usados en la shell o las últimas 20
  125. ;; expresiones regulares usadas.
  126. (when (fboundp 'desktop-load-default)
  127. (desktop-load-default)
  128. (mapcar
  129. (lambda (sym) (add-to-list 'desktop-globals-to-save sym))
  130. '((buffer-name-history . 20)
  131. (dired-regexp-history . 20)
  132. (extended-command-history . 30)
  133. (file-name-history . 100)
  134. (grep-history . 30)
  135. (minibuffer-history . 50)
  136. (query-replace-history . 60)
  137. (read-expression-history . 60)
  138. (regexp-history . 60)
  139. (regexp-search-ring . 20)
  140. (search-ring . 20)
  141. (shell-command-history . 50)))
  142. (desktop-read))
  143.  
  144. ;; Fin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement