Source

python emacs / .emacs

;; Pymacs
;; Adiciona o python-mode no caminho de carregamento.
(global-font-lock-mode t)

(add-to-list 'load-path "~/.emacs.d/")
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")

;; linum
(require 'linum)

;; ido mode
(require 'ido)
(ido-mode t)

;; Inicio da configuracao python-mode.
(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))

(add-hook 'python-mode-hook
          (lambda ()
            (set (make-variable-buffer-local 'beginning-of-defun-function)
                 'py-beginning-of-def-or-class)
            (setq outline-regexp "def\\|class ")))

;; line-num
(require 'line-num)

;; slime

(add-to-list 'load-path "/opt/local/share/emacs/site-lisp/slime")
(require 'slime-autoloads)
(setq slime-lisp-implementations
     `((sbcl ("/opt/local/bin/sbcl"))
       (abcl ("/opt/local/bin/abcl"))
       (clisp ("/opt/local/bin/clisp"))))
(add-hook 'lisp-mode-hook
           (lambda ()
             (cond ((not (featurep 'slime))
                    (require 'slime) 
                    (normal-mode)))))

(eval-after-load "slime"
   '(slime-setup '(slime-fancy slime-banner)))


;; yasnippet
(add-to-list 'load-path "~/.emacs.d/yasnippet-0.6.1c")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/yasnippet-0.6.1c/snippets")
(eval-when-compile (require 'cl))



(add-hook 'python-mode-hook (lambda ()
  (define-key py-mode-map "\C-c3"
    (lambda (beg end) (interactive "r")
       (py-comment-region beg end '(4))))))

;; Inicio syntax highlighting

(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)
 '(display-time-mode t)
 '(ecb-options-version "2.32")
 '(indent-tabs-mode nil)
 '(safe-local-variable-values (quote ((encoding . UTF-8))))
 '(show-paren-mode t)
 '(speedbar-frame-parameters (quote ((minibuffer) (width . 20) (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) (unsplittable . t) (set-background-color "black"))))
 '(tab-width 4)
 '(uniquify-buffer-name-style (quote forward) nil (uniquify)))
(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.
 '(default ((t (:stipple nil :background "black" :foreground "peachpuff" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 128 :width normal :family "adobe-courier"))))
 '(background "blue")
 '(cursor ((t (:background "deepskyblue"))))
 '(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Turquoise"))))
 '(font-lock-comment-face ((t (:foreground "MediumAquamarine"))))
 '(font-lock-constant-face ((((class color) (background dark)) (:bold t :foreground "DarkOrchid"))))
 '(font-lock-doc-string-face ((t (:foreground "green2"))))
 '(font-lock-function-name-face ((t (:foreground "SkyBlue"))))
 '(font-lock-keyword-face ((t (:bold t :foreground "CornflowerBlue"))))
 '(font-lock-preprocessor-face ((t (:italic nil :foreground "CornFlowerBlue"))))
 '(font-lock-reference-face ((t (:foreground "DodgerBlue"))))
 '(font-lock-string-face ((t (:foreground "LimeGreen"))))
 '(font-lock-type-face ((t (:foreground "#9290ff"))))
 '(font-lock-variable-name-face ((t (:foreground "PaleGreen"))))
 '(font-lock-warning-face ((((class color) (background dark)) (:foreground "yellow" :background "red"))))
 '(highlight ((t (:background "CornflowerBlue"))))
 '(list-mode-item-selected ((t (:background "gold"))))
 '(makefile-space-face ((t (:background "wheat"))))
 '(mode-line ((t (:background "Navy"))))
 '(paren-match ((t (:background "darkseagreen4"))))
 '(region ((t (:background "DarkSlateBlue"))))
 '(show-paren-match ((t (:foreground "black" :background "wheat"))))
 '(show-paren-mismatch ((((class color)) (:foreground "white" :background "red"))))
 '(speedbar-button-face ((((class color) (background dark)) (:foreground "green4"))))
 '(speedbar-directory-face ((((class color) (background dark)) (:foreground "khaki"))))
 '(speedbar-file-face ((((class color) (background dark)) (:foreground "cyan"))))
 '(speedbar-tag-face ((((class color) (background dark)) (:foreground "Springgreen"))))
 '(vhdl-speedbar-architecture-selected-face ((((class color) (background dark)) (:underline t :foreground "Blue"))))
 '(vhdl-speedbar-entity-face ((((class color) (background dark)) (:foreground "darkGreen"))))
 '(vhdl-speedbar-entity-selected-face ((((class color) (background dark)) (:underline t :foreground "darkGreen"))))
 '(vhdl-speedbar-package-face ((((class color) (background dark)) (:foreground "black"))))
 '(vhdl-speedbar-package-selected-face ((((class color) (background dark)) (:underline t :foreground "black"))))
 '(widget-field ((((class grayscale color) (background light)) (:background "DarkBlue")))))

;; End vai para o fim da linha
(define-key global-map [end] 'end-of-line)

;; Home vai para o comeco da linha
(define-key global-map [home] 'beginning-of-line)

;; CTRL-End vai para o fim do documento
(define-key global-map [C-end] 'end-of-buffer)

;; CTRL-Home vai para o comeco do documento
(define-key global-map [C-home] 'beginning-of-buffer)

;; Backspace
(define-key global-map [backspace]
'delete-backward-char)

;; Delete
(define-key global-map [delete]
'delete-char)

;; soft tabs

(setq indent-tabs-mode nil)



;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
    (load
     (expand-file-name "~/.emacs.d/elpa/package.el"))
  (package-initialize))


;; date and time in status bar

(setq display-time-day-and-date t
                display-time-24hr-format t)
             (display-time)

(idle-highlight t)
(add-hook 'python-mode-hook 'idle-highlight)

(put 'narrow-to-region 'disabled nil)
(require 'psvn)
;; (set-default-font "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1")
;;

(require 'saveplace)
(setq-default save-place t)

(setq-default idle-highlight t)

(require 'goto-last-change)
(global-set-key "\C-x\C-q" 'goto-last-change)

;; gnus configuration for gmail

;; (add-to-list 'gnus-secondary-select-methods '(nnimap "gmail"
;;                                   (nnimap-address "imap.gmail.com")
;;                                   (nnimap-server-port 993)
;;                                   (nnimap-stream ssl)))


;; (setq message-send-mail-function 'smtpmail-send-it
;;       smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
;;       smtpmail-auth-credentials '(("smtp.gmail.com" 587 "lhonda@gmail.com" nil))
;;       smtpmail-default-smtp-server "smtp.gmail.com"
;;       smtpmail-smtp-server "smtp.gmail.com"
;;       smtpmail-smtp-service 587
;;       smtpmail-local-domain "yourcompany.com")


(global-set-key (kbd "C--") 'text-scale-decrease)
(global-set-key (kbd "C-+") 'text-scale-increase)


(defun color-theme-face-attr-construct (face frame)
       (if (atom face)
           (custom-face-attributes-get face frame)
         (if (and (consp face) (eq (car face) 'quote))
             (custom-face-attributes-get (cadr face) frame)
           (custom-face-attributes-get (car face) frame))))


   ;; (unless (zenburn-format-spec-works-p)
   ;;   (zenburn-define-format-spec))


(require 'zenburn)

(add-to-list 'load-path "~/.emacs.d/eproject")
    (require 'eproject)
    (require 'eproject-extras)

(global-hl-line-mode 1)
 
;; To customize the background color
(set-face-background 'hl-line "#222")  ;; Emacs 22 Only

(require 'color-theme)
(color-theme-initialize)
(load-file "~/.emacs.d/zen-and-art/zen-and-art.el")
(color-theme-zen-and-art)




(autoload 'igrep "igrep"
       "*Run `grep` PROGRAM to match REGEX in FILES..." t)
    (autoload 'igrep-find "igrep"
       "*Run `grep` via `find`..." t)
    (autoload 'igrep-visited-files "igrep"
       "*Run `grep` ... on all visited files." t)
    (autoload 'dired-do-igrep "igrep"
       "*Run `grep` on the marked (or next prefix ARG) files." t)
    (autoload 'dired-do-igrep-find "igrep"
       "*Run `grep` via `find` on the marked (or next prefix ARG) directories." t)
    (autoload 'Buffer-menu-igrep "igrep"
      "*Run `grep` on the files visited in buffers marked with '>'." t)
    (autoload 'igrep-insinuate "igrep"
      "Define `grep' aliases for the corresponding `igrep' commands." t)
;;  2. a. For completeness, you can add these forms as well:
  (autoload 'grep "igrep"
       "*Run `grep` PROGRAM to match REGEX in FILES..." t)
  (autoload 'egrep "igrep"
       "*Run `egrep`..." t)
    (autoload 'fgrep "igrep"
       "*Run `fgrep`..." t)
    (autoload 'agrep "igrep"
       "*Run `agrep`..." t)
    (autoload 'grep-find "igrep"
       "*Run `grep` via `find`..." t)
    (autoload 'egrep-find "igrep"
       "*Run `egrep` via `find`..." t)
    (autoload 'fgrep-find "igrep"
       "*Run `fgrep` via `find`..." t)
    (autoload 'agrep-find "igrep"
       "*Run `agrep` via `find`..." t)


 (require 'auto-install)