23 oct 2008

Configurando emacs para autocompletado, resaltado de sintaxis y otras cosas

Actualmente estoy en la tarea de usar emacs, para programar.
Falta mejorar varias cosas, pero por el momento mi archivo de configuracion .emacs esta quedando asi:



(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")
'(display-time-mode t)
'(ecb-options-version "2.32")
'(global-font-lock-mode t nil (font-lock))
'(global-semantic-stickyfunc-mode nil nil (semantic-util-modes))
'(safe-local-variable-values (quote ((indent-tabs-mode . 1))))
'(semantic-idle-scheduler-idle-time 3)
'(tab-width 4))
(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.
)

(require 'cc-mode)
(setq c-default-style "bsd"
c-basic-offset 4)
(setq backup-directory-alist (quote ((".*" . "~/.emacs.d/backups"))))
;; turn on paren matching
(show-paren-mode t)
(setq show-paren-style 'mixed)

;; Use "y or n" answers instead of full words "yes or no"
(fset 'yes-or-no-p 'y-or-n-p)
;; Display the time in the mode line
(setq display-time-24hr-format t)
(display-time)


(setq truncate-partial-width-windows nil)
(setq after-save-hook (quote (executable-make-buffer-file-executable-if-script-p)))
;; para asegurarte de que el fichero termina con línea vacía
(setq require-final-newline 'ask)
;;
;; eliminar espacios en blanco a final de línea y líneas vacias al final
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
(setq delete-trailing-whitespace-p t)


;;Auto-añadir paréntesis o llave de cierre
(setq skeleton-pair t)
(global-set-key "[" 'skeleton-pair-insert-maybe)
(global-set-key "(" 'skeleton-pair-insert-maybe)
(global-set-key "{" 'skeleton-pair-insert-maybe)
(global-set-key "'" 'skeleton-pair-insert-maybe)
(global-set-key "\"" 'skeleton-pair-insert-maybe)

(require 'semantic nil t)
(global-semantic-idle-scheduler-mode 1)
(global-semantic-idle-completions-mode 1)
(global-semantic-idle-summary-mode 1)
(require 'semantic-sb nil t)
(require 'semanticdb nil t)

(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)

;; Load CEDET
;; (load-file "~/cedet-VERSION/common/cedet.el")
;;
;; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas.
;; Select one of the following:

;; * This enables the database and idle reparse engines
(semantic-load-enable-minimum-features)

;; * This enables some tools useful for coding, such as summary mode
;; imenu support, and the semantic navigator
(semantic-load-enable-code-helpers)

;; * This enables even more coding tools such as the nascent intellisense mode
;; decoration mode, and stickyfunc mode (plus regular code helpers)
(semantic-load-enable-guady-code-helpers)

;; * This turns on which-func support (Plus all other code helpers)
(semantic-load-enable-excessive-code-helpers)

;; This turns on modes that aid in grammar writing and semantic tool
;; development. It does not enable any other features such as code
;; helpers above.
(semantic-load-enable-semantic-debugging-helpers)
(which-func-mode t)


(require 'semantic-ia nil t)
(global-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
(global-set-key [(control shift return)] 'semantic-ia-complete-symbol)

(setq semanticdb-default-save-directory "~/.emacs.d/semantic")

(setq semantic-load-turn-everything-on t)
(require 'semantic-load)
(global-semantic-show-unmatched-syntax-mode -1)

(require 'ctypes)
(turn-on-font-lock)
(ctypes-auto-parse-mode 1)


(require 'ecb)
(require 'ecb-autoloads)
(setq ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
;; Desactivamos el Tip of the Day de ECB...
(setq ecb-tip-of-the-day nil)
(ecb-activate)

(global-set-key [f12] 'ecb-toggle-ecb-windows)
(global-set-key [C-f12] 'ecb-activate)
(global-set-key [M-f12] 'ecb-deactivate)

(setq tex-dvi-view-command "xdvi")
;;(transient-mark-mode 1)
;;(add-hook 'text-mode-hook 'turn-on-auto-fill)




(setq-default TeX-master nil)
(setq TeX-parse-self t)
(setq TeX-auto-save t)
(load "preview-latex.el" nil t t)


(defalias 'perl-mode 'cperl-mode)






No hay comentarios.:

Publicar un comentario