;; Entra en modo de coloreado por sintaxis
(global-font-lock-mode t)
;; Si estoy en X, activa highlight-current-line (en emacs-goodies-el)
;; (require 'highlight-current-line)
;; (highlight-current-line-on t)
;; (highlight-current-line-set-bg-color "#003900")
;; Muestra pares de paréntesis/corchetes/llaves
(setq show-paren-mismatch t)
;; Si el nombre de dos archivos es igual, agrega el directorio para que el
;; nombre del buffer sea único
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)
(setq make-backup-files nil)
;; Hacer backups de forma centralizada en un directorio
;;(setq backup-directory-alist `(("." . ,(expand-file-name "~/.emacs-backups"))))
(set-language-environment "UTF-8")
(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
(setq menubar-visible-p nil)
(setq default-toolbar-visible-p nil)
;; 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.
'(current-language-environment "UTF-8")
'(transient-mark-mode t))
;; 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
;; No seguir agregando líneas en blanco al final
(setq next-line-add-newlines nil)
;; Hacer scroll línea por línea
;; 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))
(append '(("\\.txt$" . 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
;; No me gusta perder un par de líneas gracias al toolbar..
;; 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
;; 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
;; 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")