;; $Id: .emacs,v 1.1 2003/11/27 13:15:03 gfr Exp gfr $ ;[19:04:44(godo@surco)~/bin/config]> dpkg --list | grep emacs ;ii emacs-color-themes 6.5.4-1 Color themes for Emacs ;ii emacs-goodies-el 29.2-1 Miscellaneous add-ons for Emacs ;ii emacs21 21.4a+1-5.4 The GNU Emacs editor ;ii emacs21-bin-common 21.4a+1-5.4 The GNU Emacs editor's shared, architecture ;ii emacs21-common 21.4a+1-5.4 The GNU Emacs editor's shared, architecture ;ii emacsen-common 1.4.17 Common facilities for all emacsen ; # ejemplo de asignación LISP de variable: ; #(setq fill-column 20) ; # ejemplo de asignación de modos a ficheros: ; #(setq auto-mode-alist (cons '("README" . text-mode) auto-mode-alist)) ;; ===== Para fijar el modo mayor por defecto ===== ;;(require 'generic-x) (setq default-major-mode 'text-mode) ;; ===== Para personalizar el tema (colores/tipos de letra) ===== ;; para elegirlo: M-x color-theme-select Enter (require 'color-theme) ;(color-theme-initialize) (color-theme-oswald) ;; ===== Para fijar el tamaño de la ventana ===== ;; HA DE IR DESPUÉS DE FIJAR EL TEMA (ver 2 líneas que hay justo delante) (add-to-list 'default-frame-alist '(height . 40)) (add-to-list 'default-frame-alist '(width . 115)) ;; ===== Coloreo/tipado de fuentes segun sintaxis ===== ;; Turn on font-locking globally-Coloreo/tipado de fuentes segun sintaxis (global-font-lock-mode t) ;; ===== Set the highlight current line minor mode ===== ;; ¡OJO! además hay que activarlo con una línea que aparece ;; más abajo, en la sección: (custom-set-variables ... (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. '(highlight-current-line-face ((t (:background "grey12")))) '(menu ((((type x-toolkit)) (:background "grey20" :foreground "orange" :family "misc-fixed-bold")))) '(mode-line ((t (:background "grey20" :foreground "green" :box (:line-width -1 :style released-button))))) '(scroll-bar ((t (:background "grey50")))) '(tool-bar ((((type x w32 mac) (class color)) (:background "grey40" :foreground "black" :box (:line-width 1 :style released-button))))) '(tooltip ((t (:background "grey12" :foreground "green" :height 0.75 :family "misc-fixed-bold"))))) ;; ===== Enable Line and Column Numbering ===== ;; Show line-number in the mode line (line-number-mode 1) ;; Show column-number in the mode line (column-number-mode 1) ; REDEFINIENDO EL C-x C-f para abrir un fichero ; porque no me funciona por defecto (global-set-key [(control ?x) (f12)] 'find-file) ; Para cambiar rápidamente al modo c (global-set-key [(control ?x) (c)] 'c-mode) ;; Asignacion de teclas a determinadas funciones/movimientos (global-set-key (quote [home]) (quote beginning-of-line)) (global-set-key (quote [end]) (quote end-of-line)) (global-set-key (quote [C-home]) (quote beginning-of-buffer)) (global-set-key (quote [C-end]) (quote end-of-buffer)) (global-set-key (quote [delete]) (quote delete-char)) ; Uso de una instancia de Emacs como servidor para nuevas instancias. ; Esta característica es ideal a la hora de utilizar Emacs para editar ; correo electrónico: si ya hay una instancia de Emacs corriendo, ; la nueva instancia que editará el correo tardará menos en ser lanzada ; y consumirá menos recursos. Además, compartirán bufferes y kill-ring. ; (server-start) ;; (setq inhibit-startup-message t) (delete-selection-mode t) ;; Jugamos con auto-fill según modo ;; auto-fill sirve para cortar todas las líneas cuando ;; alcanzan una determinada longitud, ¿por defecto 72? (add-hook 'text-mode-hook 'turn-on-auto-fill) (add-hook 'html-helper-mode-hook 'turn-off-auto-fill) ;; (setq auto-mode-alist (cons '("mutt?*" . mail-mode) auto-mode-alist)) ; Para poner la fuente por defecto (set-default-font "-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO8859-1") ; Soporte de ficheros comprimidos (require 'jka-compr) ; Uso de Plantillas (add-hook 'find-file-hooks 'auto-insert) (setq auto-insert-directory (expand-file-name "~/.plantillas/")) ;; autoinsert.el (define-auto-insert (cons "\\.\\([Hh]\\)\\'" "My C / C++ header") '(nil "/*" (make-string 69 ?*) "\n" " * " (file-name-nondirectory buffer-file-name) "\n" " *\n" " * " (user-full-name) " <" user-mail-address ">\n" " * Time-stamp: <>\n" " *" (make-string 69 ?*) "*/\n" (let* ((noext (substring buffer-file-name 0 (match-beginning 0))) (nopath (file-name-nondirectory noext)) (ident (concat "_" (upcase nopath) "_H_"))) (concat "#ifndef " ident "\n" "#define " ident "\n\n\n" "\n\n#endif /* " ident " */\n")))) (add-hook 'sgml-mode-hook ; make all this stuff SGML-specific (function (lambda() ; everything in here will only apply in SGML mode ))) ; CALENDAR!! (setq european-calendar-style t) (setq calendar-week-start-day 1) ;; No utilices tildes en los nombres de los días, si los usas no funciona. (setq calendar-day-name-array ["Domingo" "Lunes" "Martes" "Miercoles" "Jueves" "Viernes" "Sabado"]) (setq calendar-month-name-array ["Enero" "Febrero" "Marzo" "Abril" "Mayo" "Junio" "Julio" "Agosto" "Septiembre" "Octubre" "Noviembre" "Diciembre"]) (setq calendar-latitude 37.385793) (setq calendar-longitude -5.992913) (setq calendar-location-name "Sevilla, ES") ;;(setq calendar-time-zone 120) (setq calendar-standard-time-zone-name "CET") (setq calendar-daylight-time-zone-name "CET") ; DIARY (setq view-diary-entries-initially t mark-diary-entries-in-calendar t number-of-diary-entries 7) (add-hook 'diary-display-hook 'fancy-diary-display) (add-hook 'today-visible-calendar-hook 'calendar-mark-today) ;; ===== OJO Definición de variables muy importantes ===== (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. '(all-christian-calendar-holidays t) '(auto-save-list-file-prefix "~/Autosaves/saves-") '(calendar-holiday-marker (quote holiday-face)) '(calendar-holidays (quote ((holiday-fixed 1 1 "Año NUevo") (holiday-fixed 1 6 "Día de los Reyes Magos") (holiday-fixed 2 28 "Día de Andalucía") (holiday-fixed 5 1 "Día del Trabajo") (holiday-fixed 5 30 "San Fernando") (holiday-fixed 8 15 "La Virgen de Agosto") (holiday-fixed 10 12 "Día de la Hispanidad") (holiday-fixed 11 1 "Todos los Santos") (holiday-fixed 12 6 "Aniversario de la Constitución") (holiday-fixed 12 8 "Inmaculada Concepción") (holiday-fixed 12 24 "Noche Buena") (holiday-fixed 12 31 "Noche Vieja") (if all-christian-calendar-holidays (holiday-fixed 1 6 "Epifanía")) (if all-christian-calendar-holidays (holiday-fixed 8 15 "Asunción")) (holiday-fixed 12 25 "Día de Navidad")))) '(calendar-today-marker (quote calendar-today-face)) '(case-fold-search t) '(christian-holidays (quote ((if all-christian-calendar-holidays (holiday-fixed 1 6 "Epifanía")) (holiday-easter-etc) (if all-christian-calendar-holidays (holiday-greek-orthodox-easter)) (if all-christian-calendar-holidays (holiday-fixed 8 15 "Asunción")) (if all-christian-calendar-holidays (holiday-advent)) (holiday-fixed 12 25 "Día de Navidad")))) '(column-number-mode t) '(delete-old-versions t) '(display-time-24hr-format t) '(display-time-mode t) '(general-holidays (quote ((holiday-fixed 1 1 "Año NUevo") (holiday-fixed 1 6 "Día de los Reyes Magos") (holiday-fixed 2 28 "Día de Andalucía") (holiday-fixed 5 1 "Día del Trabajo") (holiday-fixed 5 30 "San Fernando") (holiday-fixed 8 15 "La Virgen de Agosto") (holiday-fixed 10 12 "Día de la Hispanidad") (holiday-fixed 11 1 "Todos los Santos") (holiday-fixed 12 6 "Aniversario de la Constituación") (holiday-fixed 12 8 "Inmaculada Concepción")))) '(global-font-lock-mode t nil (font-lock)) '(hebrew-holidays nil) '(highlight-current-line-globally t nil (highlight-current-line)) '(html-helper-mode-hook (quote (turn-off-auto-fill html-helper-mode-hook-identify)) t) '(islamic-holidays nil) '(local-holidays (quote ((holiday-fixed 5 30 "San Fernando") (holiday-fixed 12 24 "Noche Buena") (holiday-fixed 12 30 "Noche Vieja")))) '(mark-holidays-in-calendar t) '(org-agenda-files (quote ("~/sincro/tsol/tareas.org"))) '(oriental-holidays nil) '(scroll-bar-mode (quote right)) '(show-paren-mode t nil (paren)) '(solar-holidays nil) '(text-mode-hook (quote (text-mode-hook-identify))) '(transient-mark-mode t) '(version-control t) '(view-calendar-holidays-initially t)) ; APPOINTMENTS ;(display-time) ;(add-hook 'diary-hook 'appt-make-list) ;(diary 0) ; Ruedecita del ratón (defun up-slightly () (interactive) (scroll-up 5)) (defun down-slightly () (interactive) (scroll-down 5)) (global-set-key [mouse-4] 'down-slightly) (global-set-key [mouse-5] 'up-slightly) (defun up-one () (interactive) (scroll-up 1)) (defun down-one () (interactive) (scroll-down 1)) (global-set-key [S-mouse-4] 'down-one) (global-set-key [S-mouse-5] 'up-one) (defun up-a-lot () (interactive) (scroll-up)) (defun down-a-lot () (interactive) (scroll-down)) (global-set-key [C-mouse-4] 'down-a-lot) (global-set-key [C-mouse-5] 'up-a-lot) ;; === Para undo y redo === ;; El fichero necesario lo tienes en bin/config ;; y dentro de el está dónde tienes que copiarlo en Debian ;; http://www.emacswiki.org/emacs/RedoMode (require 'redo) (global-set-key [(control ?-)] 'undo) (global-set-key [(control ?+)] 'redo) ;; === Para autoajustar las líneas a la ventana === ;(require 'longlines) ;(setq longlines-wrap-follows-window-size t) ;; === Para autoajustar las líneas bajo demanda: pulsando F7 === ;; Probado y funciona (global-set-key (kbd "") 'toggle-truncate-lines) ;; Probado y funciona ;; turn on soft wrapping mode for org mode ;(add-hook 'org-mode-hook ;(lambda () (setq truncate-lines nil))) ;; Otra cosa que funciona (http://lists.gnu.org/archive/html/emacs-orgmode/2009-04/msg00653.html) (setq org-startup-truncated nil) ;; ===== Para mi modo .god ===== ;; Información obtenida de http://www.emacswiki.org/cgi-bin/wiki/GenericMode (define-generic-mode 'god-mode '("#") '("*" "***" "pdte") ;; Posibles font-lock-*-face ;; warning variable-name function-name type '(("+++\\|+" . 'font-lock-type-face) ("\\(<[0-9]+>\\)" . 'font-lock-type-face) ("\\(---\\)" 1 'font-lock-variable-name-face) ) '(".gfr\\'" ".god\\'") nil "Major mode que se aplica a ficheros .god lista de tareas.") ;; ===== PARA EL MODO .org ===== ;; The following lines are always needed. Choose your own keys. (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (define-key global-map "\C-cl" 'org-store-link) (define-key global-map "\C-ca" 'org-agenda) (add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only ;;(add-hook 'org-mode-hook 'longlines-mode) (setq org-agenda-include-diary t) ; integración con fichero diary