Screaming Loud



;;        表示          ;;

(show-paren-mode t)

;同名のファイルを開いたとき Switch to buffer などでファイル名がわかりやすく見えるようになる設定
(require 'uniquify)
(setq uniquify-buffer-name-style 'post-forward-angle-brackets)

(setq-default transient-mark-mode t)

;; マッチした場合の色
(set-face-background 'show-paren-match-face "RoyalBlue1")
(set-face-foreground 'show-paren-match-face "black")
;; マッチしていない場合の色
(set-face-background 'show-paren-mismatch-face "Red")
(set-face-foreground 'show-paren-mismatch-face "black")

;(require 'menu-tree t)

;;        基本          ;;

;; C-kで改行も含めてカットする
(setq kill-whole-line t)

;; Ctrl+Zで最小化しない
(define-key global-map "\C-z" 'scroll-down)

(setq read-file-name-completion-ignore-case t)

(setq make-backup-files nil)

;; 行数を表示させる
(require 'linum)
(global-linum-mode t)
(setq linum-format "%4d ")

(global-set-key "\C-x\C-i" 'indent-region)

(setq scroll-step 1)

(defadvice backward-delete-char-untabify
  (around ys:backward-delete-region activate)
  (if (and transient-mark-mode mark-active)
      (delete-region (region-beginning) (region-end))

;;        補完          ;;

(setq load-path (cons "/home/lr/yuto/emacs-setup/auto-complete-1.3.1" load-path))
(require 'auto-complete)
(global-auto-complete-mode t)

(setq ac-auto-start nil)
(ac-set-trigger-key "TAB")

;;        折り畳み          ;;

(add-hook 'python-mode-hook 'my-python-hook)

(defun py-outline-level ()
"This is so that `current-column` DTRT in otherwise-hidden text"
;; from ada-mode.el
(let (buffer-invisibility-spec)
(skip-chars-forward "\t ")

; this fragment originally came from the web somewhere, but the outline-regexp
; was horribly broken and is broken in all instances of this code floating
; around. Finally fixed by Charl P. Botha <<a href=""></a>>
(defun my-python-hook ()
(setq outline-regexp "[^ \t\n]\\|[ \t]*\\(def[ \t]+\\|class[ \t]+\\)")
; enable our level computation
(setq outline-level 'py-outline-level)
; do not use their \C-c@ prefix, too hard to type. Note this overides
;some python mode bindings
(setq outline-minor-mode-prefix "\C-c")
; turn on outline mode
(outline-minor-mode t)
; initially hide all but the headers
(show-paren-mode 1)

;;        Load Path          ;;
(setq load-path(append(list(expand-file-name "/home/lr/yuto/.emacs.d"))load-path))

;;          Lookup           ;;
  (autoload 'lookup "lookup" nil t)
  (autoload 'lookup-region "lookup" nil t)
  (autoload 'lookup-pattern "lookup" nil t)
  (setq lookup-search-agents '((ndtp "dserver") (ndspell)))

;;        Python          ;;

;; pysmell
(setq load-path (cons "/home/lr/yuto/emacs-setup/pysmell-0.7.3" load-path))
(require 'pysmell)
(add-hook 'python-mode-hook (lambda () (pysmell-mode 1)))
(defvar ac-source-pysmell
     . (lambda ()
         (require 'pysmell)
(add-hook 'python-mode-hook
          '(lambda ()
             (set (make-local-variable 'ac-sources) (append ac-sources '(ac-source-pysmell)))))

;; python-mode
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode)
(autoload 'python-mode "python-mode" "Python editing mode." t)

;; pycomplete
(add-hook 'python-mode-hook '(lambda () 
     (require 'pycomplete)))

;; pymacs
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(eval-after-load "pymacs"
  '(add-to-list 'pymacs-load-path "/home/lr/yuto/emacs-setup/python-mode"))