2009年9月1日火曜日

my .emacs

あんまりつかってない。

~/.emacs.d
|-- anything-c-adaptive-history
|-- auto-save-list
|-- inits
| |-- carbon-emacs-config.el
| `-- carbon-emacs-config.el~
|-- pymacs
| |-- BROWSE
| |-- pycomplete.py
| |-- pycomplete.pyc
| `-- s
|-- session.10a0230263117f221b124556172627762400000038860115
|-- site-lisp -> ../site-lisp
`-- snippets
`-- text-mode
|-- cc-mode
| |-- c++-mode
| | |-- beginend
| | |-- class
| | |-- ns
| | |-- template
| | `-- using
| |-- c-mode
| | `-- fopen
| |-- csharp-mode
| | |-- attrib
| | |-- attrib.1
| | |-- attrib.2
| | |-- class
| | |-- comment
| | |-- comment.1
| | |-- comment.2
| | |-- comment.3
| | |-- method
| | |-- namespace
| | |-- prop
| | |-- region
| | |-- using
| | |-- using.1
| | `-- using.2
| |-- do
| |-- for
| |-- if
| |-- inc
| |-- inc.1
| |-- main
| |-- objc-mode
| | `-- prop
| |-- once
| `-- struct
|-- css-mode
| |-- bg
| |-- bg.1
| |-- bor
| |-- cl
| |-- disp.block
| |-- disp.inline
| |-- disp.none
| |-- ff
| |-- fs
| |-- mar.bottom
| |-- mar.left
| |-- mar.mar
| |-- mar.margin
| |-- mar.right
| |-- mar.top
| |-- pad.bottom
| |-- pad.left
| |-- pad.pad
| |-- pad.padding
| |-- pad.right
| `-- pad.top
|-- email
|-- erlang-mode
| |-- after
| |-- begin
| |-- beh
| |-- case
| |-- compile
| |-- def
| |-- exp
| |-- fun
| |-- if
| |-- ifdef
| |-- ifndef
| |-- imp
| |-- inc
| |-- inc.lib
| |-- loop
| |-- mod
| |-- rcv
| |-- rcv.after
| |-- rec
| |-- try
| `-- undef
|-- f90-mode
| |-- au
| |-- bd
| |-- c
| |-- ch
| |-- cx
| |-- dc
| |-- do
| |-- dp
| |-- eq
| |-- ib
| |-- ic
| |-- ich
| |-- if
| |-- ii
| |-- il
| |-- in
| |-- inc
| |-- intr
| |-- ir
| |-- l
| |-- pa
| |-- pr
| |-- re
| |-- st
| |-- su
| `-- wr
|-- html-mode
| |-- body
| |-- br
| |-- code
| |-- code.class
| |-- dd
| |-- div
| |-- div.class
| |-- div.id
| |-- div.id-class
| |-- dl
| |-- dl.id
| |-- doctype
| |-- doctype.xhml1
| |-- doctype.xhtml1_1
| |-- doctype.xhtml1_strict
| |-- doctype.xhtml1_transitional
| |-- dt
| |-- form
| |-- h1
| |-- h2
| |-- h3
| |-- h4
| |-- h5
| |-- h6
| |-- head
| |-- hr
| |-- href
| |-- html
| |-- html.xmlns
| |-- img
| |-- input
| |-- li
| |-- li.class
| |-- link.stylesheet
| |-- link.stylesheet-ie
| |-- mailto
| |-- meta
| |-- meta.http-equiv
| |-- ol
| |-- ol.class
| |-- ol.id
| |-- p
| |-- pre
| |-- quote
| |-- script.javascript
| |-- script.javascript-src
| |-- span
| |-- span.class
| |-- span.id
| |-- style
| |-- table
| |-- td
| |-- textarea
| |-- th
| |-- title
| |-- tr
| |-- ul
| |-- ul.class
| `-- ul.id
|-- latex-mode
| `-- begin
|-- markdown-mode
| |-- +
| |-- -
| |-- _
| |-- __
| |-- `
| |-- h1.1
| |-- h1.2
| |-- h2.1
| |-- h2.2
| |-- h3
| |-- h4
| |-- h5
| |-- h6
| |-- hr.1
| |-- hr.2
| |-- img
| |-- link
| |-- ol
| |-- rimg
| |-- rlb
| `-- rlink
|-- nxml-mode
| |-- body
| |-- br
| |-- code
| |-- div
| |-- doctype
| |-- doctype.xhtml1_strict
| |-- doctype.xhtml1_transitional
| |-- form
| |-- h1
| |-- h2
| |-- h3
| |-- h4
| |-- h5
| |-- h6
| |-- head
| |-- hr
| |-- href
| |-- html
| |-- img
| |-- input
| |-- li
| |-- link
| |-- meta
| |-- name
| |-- ol
| |-- p
| |-- pre
| |-- quote
| |-- span
| |-- style
| |-- table
| |-- tag.1l
| |-- tag.2l
| |-- td
| |-- th
| |-- title
| |-- tr
| `-- ul
|-- perl-mode
| |-- cperl-mode
| |-- eval
| |-- for
| |-- fore
| |-- if
| |-- ife
| |-- ifee
| |-- sub
| |-- unless
| |-- while
| |-- xfore
| |-- xif
| |-- xunless
| `-- xwhile
|-- python-mode
| |-- __
| |-- class
| |-- def
| |-- defm
| |-- for
| |-- ifmain
| |-- propg
| |-- propsg
| `-- while
|-- rst-mode
| |-- chap
| |-- sec
| `-- tit
|-- ruby-mode
| |-- #
| |-- =b
| |-- Comp
| |-- all
| |-- am
| |-- any
| |-- app
| |-- bm
| |-- case
| |-- cla
| |-- classify
| |-- cls
| |-- collect
| |-- dee
| |-- deli
| |-- det
| |-- dow
| |-- ea
| |-- eac
| |-- eai
| |-- eav
| |-- eawi
| |-- forin
| |-- if
| |-- ife
| |-- inject
| |-- mm
| |-- r
| |-- rb
| |-- reject
| |-- req
| |-- rreq
| |-- rw
| |-- select
| |-- tim
| |-- until
| |-- upt
| |-- w
| |-- when
| |-- while
| |-- y
| `-- zip
|-- scala-mode
| |-- act
| |-- act.arg
| |-- actor
| |-- ano
| |-- app
| |-- arr.new
| |-- arr.val-new
| |-- asof
| |-- ass
| |-- ass.true
| |-- at.author
| |-- at.param
| |-- at.return
| |-- at.version
| |-- bang
| |-- case
| |-- case.match-all
| |-- cast
| |-- cc
| |-- cl
| |-- cl.abs
| |-- cl.abs-arg
| |-- cl.arg
| |-- clof
| |-- co
| |-- cons
| |-- cons.nil
| |-- def.arg
| |-- def.arg-body
| |-- def.arg-ret
| |-- def.arg-ret-body
| |-- def.body
| |-- def.ret
| |-- def.ret-body
| |-- def.simple
| |-- doc.class
| |-- doc.def
| |-- doc.file
| |-- doc.file-scala
| |-- doc.file-scala-api
| |-- doc.scaladoc
| |-- expect
| |-- ext
| |-- for.extract
| |-- for.if
| |-- for.loop
| |-- for.multi
| |-- foreach
| |-- hmap.new
| |-- hmap.val-new
| |-- hset.new
| |-- hset.val-new
| |-- if
| |-- if.else
| |-- imp
| |-- intercept
| |-- isof
| |-- ls.new
| |-- ls.val-new
| |-- main
| |-- map
| |-- map.new
| |-- match
| |-- match.can
| |-- match.option
| |-- mix
| |-- ob
| |-- pac
| |-- pr.newline
| |-- pr.simple
| |-- pr.string
| |-- pr.trace
| |-- pri
| |-- pri.param
| |-- pro
| |-- pro.param
| |-- suite
| |-- test
| |-- throw
| |-- tr
| |-- tr.ext
| |-- tr.ext-with
| |-- tr.with
| |-- try
| |-- try.catch-finally
| |-- try.finally
| |-- tup.arrow
| |-- tup.paren
| |-- val
| |-- val.new
| |-- val.ret
| |-- var
| |-- var.new
| |-- var.ret
| |-- whi
| `-- with
|-- sql-mode
| |-- column
| |-- constraint
| |-- constraint.1
| |-- create
| |-- create.1
| `-- references
`-- time

25 directories, 396 files

~/.emacs.d/site-lisp
|-- ac-dabbrev.el
|-- anything-config.el
|-- anything-etags.el
|-- anything-gtags.el
|-- anything-match-plugin.el
|-- anything-yaetags.el
|-- anything.el
|-- auto-complete.el
|-- grep-edit.el
|-- init-loader.el
|-- install-elisp.el
|-- migemo.el
|-- pymacs.el
|-- revive.el
|-- rst.el
|-- rst.elc
|-- sense-region.el
|-- windows.el
`-- yasnippet.el

0 directories, 19 files



;;; arch
;; .emacs で OS の判定を関数化しよう - msshの日記 http://d.hatena.ne.jp/mssh/20081208/1228742294
(defvar os-type nil)
(cond ((string-match "apple-darwin" system-configuration) ;; Mac
(setq os-type 'mac))
((string-match "linux" system-configuration) ;; Linux
(setq os-type 'linux))
((string-match "freebsd" system-configuration) ;; FreeBSD
(setq os-type 'bsd))
((string-match "mingw" system-configuration) ;; Windows
(setq os-type 'win)))
(defun mac? ()
(eq os-type 'mac))
(defun linux? ()
(eq os-type 'linux))
(defun bsd? ()
(eq os-type 'freebsd))
(defun win? ()
(eq os-type 'win))
;;;; Font settings
(set-language-environment "English")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
;;;; View settings
(if window-system (progn
(set-background-color "Black")
(set-foreground-color "Green")
(set-face-foreground 'font-lock-comment-face "dark orange")
(set-face-foreground 'font-lock-string-face "slateGray1")
(set-face-foreground 'font-lock-keyword-face "violet")
(set-face-foreground 'font-lock-constant-face "yellow")
(set-face-foreground 'font-lock-function-name-face "maroon2")
(set-face-foreground 'font-lock-variable-name-face "deep sky blue")
(set-face-foreground 'font-lock-type-face "wheat1")
(set-face-foreground 'font-lock-warning-face "violet")
(set-face-bold-p 'font-lock-function-name-face t)
(set-face-bold-p 'font-lock-warning-face nil)
(set-cursor-color "Gray")
(set-frame-parameter nil 'alpha 80)
))
(setq inhibit-startup-message t)
;; (tool-bar-mode nil)
(set-scroll-bar-mode nil)
(line-number-mode t)
;; hightlight cursor line
;; http://blog.iwa-ya.net/2009/06/21/093100
(defface hlline-face
'((((class color)
(background dark))
;;(:background "dark state gray"))
(:background "gray10"
:underline "gray24"))
(((class color)
(background light))
(:background "ForestGreen"
:underline nil))
(t ()))
"*Face used by hl-line.")
(setq hl-line-face 'hlline-face)
;;(setq hl-line-face 'underline)
(global-hl-line-mode)
;; Full screen
(defun toggle-fullscreen ()
(interactive)
(set-frame-parameter nil 'fullscreen
(if (frame-parameter nil 'fullscreen) nil 'fullboth)))
(if window-system
(progn
(setq default-frame-alist
(append
'((width . 150) (height . 70)
(background-color . "Black")
)
default-frame-alist))))
;====================================
;====================================
(defface my-face-b-1 '((t (:background "medium aquamarine"))) nil)
(defface my-face-b-1 '((t (:background "dark turquoise"))) nil)
(defface my-face-b-2 '((t (:background "cyan"))) nil)
(defface my-face-b-2 '((t (:background "SeaGreen"))) nil)
(defface my-face-u-1 '((t (:foreground "SteelBlue" :underline t))) nil)
(defvar my-face-b-1 'my-face-b-1)
(defvar my-face-b-2 'my-face-b-2)
(defvar my-face-u-1 'my-face-u-1)
(defadvice font-lock-mode (before my-font-lock-mode ())
(font-lock-add-keywords
major-mode
'(
(" " 0 my-face-b-1 append)
("\t" 0 my-face-b-2 append)
("[ ]+$" 0 my-face-u-1 append)
)))
;;;; Key settings
;; Ctrl-h
(keyboard-translate ?\C-h ?\C-?)
(global-set-key "\C-h" nil)
(global-set-key "\M-h" 'help-command)
(setq mac-command-modifier 'meta)
(setq mac-control-modifier 'control)
(setq mac-option-modifier 'alt)
;;; Core settings
(auto-compression-mode t)
(recentf-mode 1)
(pc-selection-mode 1)
(setq show-paren-mode 1)
(setq c-tab-always-indent t)
(setq default-tab-width 4)
(setq indent-line-function 'indent-relative-maybe)
;;(ad-enable-advice 'font-lock-mode 'before 'my-font-lock-mode)
;;(ad-activate 'font-lock-mode)
;;(add-hook 'find-file-hooks '(lambda ()
;; (if font-lock-mode
;; nil
;; (font-lock-mode t))))
(setq frame-title-format (format "emacs@%s : %%f" (system-name)))
;;;; Key settings
(define-key minibuffer-local-filename-completion-map
" " 'minibuffer-complete-word)
(define-key minibuffer-local-must-match-filename-map
" " 'minibuffer-complete-word)
;; Plugins load
(defun my-load-path (path)
(let ((epath (expand-file-name path)))
(unless (member epath load-path)
(setq load-path (cons epath load-path)))))
(my-load-path "~/.emacs.d/site-lisp")
(my-load-path "/usr/share/emacs/site-lisp/ddskk")
(my-load-path "/usr/share/emacs/site-lisp")
(my-load-path "/usr/share/emacs/site-lisp/howm")
;(my-load-path "/Applications/MacPorts/Emacs.app/Contents/Resources/lisp")
;; howm
(require 'howm)
;; rst.el
;; Emacs で ReStructuredText - SPEAKER BREAKA
;; http://d.hatena.ne.jp/namaco35/20090526/1243355997
(require 'rst)
(setq auto-mode-alist
(append '(("\\.txt$" . rst-mode)
("\\.howm$" . rst-mode)
("\\.rst$" . rst-mode)
("\\.rest$" . rst-mode)) auto-mode-alist))
(add-hook 'rst-adjust-hook 'rst-toc-update)
(add-hook 'rst-mode-hook
(lambda ()
(setq rst-slides-program "open -a Firefox")
))
;;(require 'vc-git)
;;(require 'git-emacs)
;;(require 'git-blame)
(require 'grep-edit)
;;;; ddskk
;(require 'skk) (setq skk-large-jisyo"/usr/share/skk/SKK-JISYO.L")
;;;;;;;;;;;;;;
; GUNU Linux
;;;;;;;;;;;;;;
;; uim
;(cond
;((string-match "linux" system-configuration)
; (my-load-path "/usr/share/emacs/site-lisp/uim")
; (require 'uim)
; (global-set-key "\C-o" 'uim-mode)
;))
(autoload 'ansi-color-for-comint-mode-on "ansi-color"
"Set `ansi-color-for-comint-mode' to t." t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; auto-complete
(require 'auto-complete)
(global-auto-complete-mode t)
(require 'ac-dabbrev)
(setq ac-sources
(list ac-source-dabbrev))
;; Filetype
;; php-mode
(add-hook 'php-mode-hook
(lambda ()
(require 'php-completion)
(php-completion-mode t)
(define-key php-mode-map (kbd "C-o") 'phpcmp-complete)
(when (require 'auto-complete nil t)
(make-variable-buffer-local 'ac-sources)
(add-to-list 'ac-sources 'ac-source-php-completion)
(auto-complete-mode t))))
;; js2-mode
;(autoload 'js2-mode "js2" nil t)
;(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))
;; http://8-p.info/emacs-javascript.html
;(setq-default c-basic-offset 4)
;(when (load "js2" t)
; (setq js2-cleanup-whitespace nil
; js2-mirror-mode nil
; js2-bounce-indent-flag nil)
; (defun indent-and-back-to-indentation ()
; (interactive)
; (indent-for-tab-command)
; (let ((point-of-indentation
; (save-excursion
; (back-to-indentation)
; (point))))
; (skip-chars-forward "\s " point-of-indentation)))
;
; (define-key js2-mode-map "\C-i" 'indent-and-back-to-indentation)
; (define-key js2-mode-map "\C-m" nil))
;; java-mode
(add-hook 'java-mode-hook
'(lambda ()
(c-set-style "stroustrup")
(setq tab-width 4)
(setq indent-tabs-mode nil)
))
;;;; Python settings
(require 'python)
;; pymacs
;(require '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 "~/.emacs.d/pymacs/"))
;; python-mode, pycomplete
;(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
;(add-to-list 'interpreter-mode-alist '("python" . python-mode))
;(setq interpreter-mode-alist (cons '("python" . python-mode)
; interpreter-mode-alist))
;(autoload 'python-mode "python-mode" "Python editing mode." t)
;(add-hook 'python-mode-hook '(lambda ()
; (require 'pycomplete)
; ))
;; ropemacs
;;(pymacs-load "ropemacs" "rope-")
;;(setq ropemacs-enable-autoimport t)
;(require 'ipython)
;(setq ipython-command "/opt/local/bin/ipython"))
; (require 'pysmell)
;(add-hook 'python-mode-hook (lambda () (pysmell-mode 1)))
;(add-hook 'python-mode-hook
; '(lambda ()
; (define-key python-mode-map "\C-m" 'newline-and-indent)
; (define-key python-mode-map "\M-\"" 'electric-pair)
; (define-key python-mode-map "\M-\'" 'electric-pair)
; (define-key python-mode-map "\M-[" 'electric-pair)
; (define-key python-mode-map "\M-{" 'electric-pair)
; (define-key python-mode-map "\M-(" 'electric-pair)
; (define-key inferior-python-mode-map "\t" 'python-complete-symbol)
; ))
;(defvar ac-source-pysmell
; '((candidates
; . (lambda ()
; (require 'pysmell)
; (pysmell-get-all-completions))))
; "Source for PySmell")
;
;(add-hook 'python-mode-hook
; '(lambda ()
; (set (make-local-variable 'ac-sources) (append ac-sources '(ac-source-pysmell)))))
;;scheme-complete
;(require 'scheme-complete)
;(eval-after-load 'scheme
; '(progn
; (setq scheme-default-implementation 'gauche)
; (setq *scheme-current-implementation* 'gauche)
; ;; scheme-smart-complete: M-TAB
; (define-key scheme-mode-map "\C-t" 'scheme-smart-complete)
; ;; scheme-complete-or-indent: TAB
; (define-key scheme-mode-map "\t" 'scheme-complete-or-indent))
;)
;(add-hook 'scheme-mode-hook
;(lambda ()
;(setq default-scheme-implementation 'gauche)
;(setq *current-scheme-implementation* 'gauche)
;; eldoc-mode
;;(setq (make-local-variable 'eldoc-documentation-function)
; 'scheme-get-current-symbol-info)
;(eldoc-mode t)
;)
;; install-elisp.el *package installer
(require 'install-elisp)
(setq install-elisp-repository-directory "~/.emacs.d/site-lisp")
;; migemo
(load "migemo.el")
(setq migemo-command "/opt/local/bin/cmigemo")
(setq migemo-options '("-q" "--emacs" "-i" "¥a"))
(setq migemo-dictionary (expand-file-name "~/local/migemo/migemo-dict"))
;(setq migemo-dictionary "/opt/local/share/migemo/utf-8/migemo-dict")
(setq migemo-user-dictionary nil)
(setq migemo-regex-dictionary nil)
;; anything
(require 'anything)
(require 'anything-config)
(require 'anything-match-plugin)
(setq anything-sources (list anything-c-source-buffers+
anything-c-source-bookmarks
anything-c-source-recentf
anything-c-source-buffer-not-found
anything-c-source-imenu
anything-c-source-file-name-history
anything-c-source-locate))
(setq imenu-auto-rescan t)
(define-key anything-map (kbd "C-p") 'anything-previous-line)
(define-key anything-map (kbd "C-n") 'anything-next-line)
(define-key anything-map (kbd "C-v") 'anything-next-source)
(define-key anything-map (kbd "M-v") 'anything-previous-source)
(global-set-key (kbd "C-;") 'anything)
(require 'anything-etags)
(add-to-list 'anything-sources 'anything-c-source-etags-select)
(require 'anything-yaetags)
(add-to-list 'anything-sources 'anything-c-source-yaetags-select)
(global-set-key (kbd "M-.") 'anything-yaetags-find-tag)
;; session
(when (locate-library "session")
(setq session-globals-max-size 512)
(setq session-globals-regexp "-\\(ring\\|history\\|hist\\)\\'")
(require 'session)
(defadvice find-alternate-file
(before session-store-buffer-places last activate)
"Invoke session-kill-buffer-hook."
(session-kill-buffer-hook))
(add-to-list 'session-kill-buffer-commands 'find-alternate-file)
(add-hook 'after-init-hook 'session-initialize))
(when (locate-library "minibuf-isearch")
(setq minibuf-isearch-indicator-string nil)
(setq minibuf-isearch-display-message-always t)
(setq minibuf-isearch-match-format-string "[isearch with '%s']")
(setq minibuf-isearch-no-match-format-string "[No further match with '%s']")
(setq minibuf-isearch-message-on-right t)
(setq history-length 128)
(require 'minibuf-isearch))
;; window
;(require 'windows)
;(setq win:use-frame nil)
;(win:startup-with-window)
;(define-key ctl-x-map "C" 'see-you-again)
;; sense-region.el
;(autoload 'sense-region-on "sense-region"
; "System to toggle region and rectangle." t nil)
;(sense-region-on)
;; emacs23 用設定
;(cond ( (string-match "^23\." emacs-version)
; (cond (window-system
; (set-default-font "Bitstream Vera Sans Mono-12")
; (set-fontset-font (frame-parameter nil 'font)
; 'japanese-jisx0208
; '("IPA モナー ゴシック" . "unicode-bmp"))
; ))
;))
;; init-loader
(require 'init-loader)
(init-loader-load (expand-file-name "~/.emacs.d/inits"))
;; yasnippet.el
(require 'yasnippet)
(setq yas/trigger-key (kbd "C-c <kp-multiply>"))
(yas/initialize)
(yas/load-directory "~/.emacs.d/snippets")
(put 'upcase-region 'disabled nil)
view raw .emacs hosted with ❤ by GitHub

0 件のコメント:

コメントを投稿