Detail: .emacs (text)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
;; Entra en modo de coloreado por sintaxis
(global-font-lock-mode t)

;; Si estoy en X, activa highlight-current-line (en emacs-goodies-el)
;;(cond (window-system
;;       (require 'highlight-current-line)
;;       (highlight-current-line-on t)
;;       (highlight-current-line-set-bg-color "#003900")
;;))
 
;; Muestra pares de paréntesis/corchetes/llaves
(require 'paren)
(show-paren-mode)
(setq show-paren-mismatch t)

;; Si el nombre de dos archivos es igual, agrega el directorio para que el
;; nombre del buffer sea único
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)

;; No hacer backup files
(setq make-backup-files nil)
;; Hacer backups de forma centralizada en un directorio
;;(setq backup-directory-alist `(("." . ,(expand-file-name "~/.emacs-backups"))))

;; Encoding por defecto
(set-language-environment "UTF-8")


;; CUA Mode
(cua-mode t)
(setq cua-auto-tabify-rectangles nil) ;; Don't tabify after rectangle commands
(transient-mark-mode 1) ;; No region when it is not highlighted
(setq cua-keep-region-after-copy t) ;; Standard Windows behaviour

;; hide the menu bar
;;
;;(menu-bar-mode nil)
(tool-bar-mode nil)
(setq menubar-visible-p nil)
(setq default-toolbar-visible-p nil)

;; hide the scroll bar
;;
(scroll-bar-mode nil)
(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(column-number-mode t)
 '(current-language-environment "UTF-8")
 '(show-paren-mode t)
 '(transient-mark-mode t))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

;; Mostrar número actual de línea y columna
(setq line-number-mode t)
(setq column-number-mode t)

;; Mostrar los bloques marcados mientras los estamos marcando
(setq transient-mark-mode t)
;; La campana se ve, no se oye
(setq visible-bell t)
;; No seguir agregando líneas en blanco al final
(setq next-line-add-newlines nil)
;; Hacer scroll línea por línea
(setq scroll-step 1)
;; Si tenemos un display separado verticalmente, también doblar líneas largas
(setq truncate-partial-width-windows nil)
;; Agregar automáticamente fin de línea a los archivos
(setq require-final-newline t)
;; El modo default para archivos nuevos es text-mode
(setq default-major-mode 'text-mode)

;; Los archivos .tmpl, .rhtml y .html.erb son templates de HTML
(setq auto-mode-alist (cons '("tmpl$" . html-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("rhtml$" . html-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("html.erb$" . html-mode) auto-mode-alist))

(require 'rst)
(setq auto-mode-alist
      (append '(("\\.txt$" . rst-mode)
                ("\\.rst$" . rst-mode)
                ("\\.rest$" . rst-mode)) auto-mode-alist))
(add-hook 'rst-adjust-hook 'rst-toc-update)

;; Los archivos .t son tests de Perl
(setq auto-mode-alist (cons '("\\\.t$" . perl-mode) auto-mode-alist))

;; Los archivos llamados /tmp/mutt* son abiertos en mail-mode
(setq auto-mode-alist (cons '("^/tmp/mutt" . mail-mode) auto-mode-alist))

;; .emacs es abierto en lisp-mode
(setq auto-mode-alist (cons '(".emacs$" . lisp-mode) auto-mode-alist))

;; Cuando hacemos un diff, que sea en modo unified
(setq diff-switches '-u)

;; No me gusta perder un par de líneas gracias al toolbar..
(setq tool-bar-mode nil)

;; Muestra como título de la ventana/icono el nombre del archivo abierto
;; (%f - filename, más largo. %b - buffer, más corto)
(setq frame-title-format "Emacs - %f")
(setq icon-title-format "Emacs - %b")
;; Seguimos ligas simbólicas aún si apuntan a un archivo controlado por CVS
(setq vc-follow-symlinks t)
;; Recordamos nuestra posición en el buffer 
(setq save-place t)
;; Evitamos el splash screen al cargar, no sirve de nada...
(setq inhibit-startup-message t)
 
;; Los buffers en text-mode y mail-mode tienen activado auto-fill
(add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))
(add-hook 'mail-mode-hook '(lambda () (auto-fill-mode 1)))
 
;; Si tenemos mouse con ruedita de scroll, habilítala
(cond (window-system
       (mwheel-install)
))
 
;; Si estoy desde consola, no quiero barra de menú
(if (not window-system) (menu-bar-mode -1))
 
;; Para poder teclear caracteres acentuados al usar en consola
(set-input-mode nil nil 1)
 
;; Acepta 'y' o 'n' cuando pide 'yes' o 'no'
(fset 'yes-or-no-p 'y-or-n-p)
 
;; c-mode indentation, usar solo espacios, 4
(setq-default tab-width 4)
(setq indent-tabs-mode nil)

(setq browse-url-browser-function 'browse-url-generic
      browse-url-generic-program "google-chrome")

[raw] - Pasted by: r0sk on text on Dec. 7, 2011