Skip to content

Instantly share code, notes, and snippets.

@yagihiro
Created January 25, 2009 13:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yagihiro/51782 to your computer and use it in GitHub Desktop.
Save yagihiro/51782 to your computer and use it in GitHub Desktop.
.emacs
;; Copyright (C) 2007,2008,2009,2010 Hiroki Yagita.
;; ポリシー ----------------------------------------------------------
;; - meadow は捨てました
;; - xemacs は捨てました
;; - なるべくどこでも動くようにしたい
;; - 初期化スクリプトは ~/.emacs.d/init.el にしています
;; - ~/.emacs.d/ の下に分離スクリプトやデータを置くことがあります(それ以外の場所に置かない)
;; 追加でインストールが必要になるもの --------------------------------
;; - install-elisp
;; - auto-install
;; - package-install
;; - sequential-command [M-x auto-install-batch sequential-command]
;; - anything [M-x auto-install-batch anything] via http://d.hatena.ne.jp/rubikitch/20100718/anything
;; - (install-elisp-from-emacswiki "auto-async-byte-compile.el")
;; - php-mode.el
;; - smarty-mode.el
;; key command default tty
;; -------- ---------------------- --------- -----
;; C-: --- o ---
;; C-] abort-recursive-edit o
;; C-z suspend-frame o
;; C-t transpose-chars o
;; C-@ set-mark-command o ---
;; C-, gtags-pop-stack
;; C-. --- o
;; f5 --- o
;; f6 --- o
;; f7 --- o
;; f8 --- o
;; f9 --- o
;; f10 menu-bar-open o
;; f11 --- o
;; f12 --- o
;; C-a C-a beginning-of-buffer ;; require sequential-command
;; C-e C-e end-of-buffer ;; require sequential-command
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; for portability
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; http://www.sodan.org/~knagano/emacs/dotemacs.html
(defmacro exec-if-bound (sexplist)
"関数が存在するときだけ実行する。(car の fboundp を調べるだけ)"
`(if (fboundp (car ',sexplist))
,sexplist))
(defmacro defun-add-hook (hookname &rest sexplist)
"add-hook のエイリアス。引数を関数にパックして hook に追加する。"
`(add-hook ,hookname
(function (lambda () ,@sexplist))))
(defun load-safe (loadlib)
"安全な load。読み込んで失敗してもそこで止まらない。"
;; missing-ok で読んでみて、だめならこっそり message でも出しておく
(let ((load-status (load loadlib t)))
(or load-status
(message (format "[load-safe] failed %s" loadlib)))
load-status))
(defmacro eval-safe (&rest body)
"安全な評価。評価に失敗してもそこで止まらない。"
`(condition-case err
(progn ,@body)
(error (message "[eval-safe] %s" err))))
(defun autoload-if-found (function file &optional docstring interactive type)
"set autoload iff. FILE has found."
(and (locate-library file)
(autoload function file docstring interactive type)))
;; 異なる Emacs で設定を共用するための定義
;; http://www.bookshelf.jp/soft/meadow_16.html#SEC157
(defvar run-unix
(or (equal system-type 'gnu/linux)
(equal system-type 'usg-unix-v)))
(defvar run-w32
(and (null run-unix)
(or (equal system-type 'windows-nt)
(equal system-type 'ms-dos))))
(defvar run-emacs21
(and (equal emacs-major-version 21)
(null (featurep 'xemacs))))
(defvar run-emacs22
(and (equal emacs-major-version 22)
(null (featurep 'xemacs))))
(defvar run-emacs23
(and (equal emacs-major-version 23)
(null (featurep 'xemacs))))
(defvar run-gnu-emacs
(not (or (featurep 'xemacs) (featurep 'meadow))))
(defvar run-gnu-emacs-w32 (and run-gnu-emacs run-w32))
(defvar run-gnu-emacs-22-w32 (and run-emacs22 run-gnu-emacs-w32))
(defvar run-gnu-emacs-23-w32 (and run-emacs23 run-gnu-emacs-w32))
(defvar run-gnu-emacs-unix (and run-gnu-emacs run-unix))
(defvar run-gnu-emacs-22-unix (and run-emacs22 run-gnu-emacs-unix))
(defvar run-gnu-emacs-23-unix (and run-emacs23 run-gnu-emacs-unix))
;; emacs/share をデータディレクトリとする
(defvar site-data-directory "~/.emacs.d/share/")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; initialize
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; http://memo.jj-net.jp/41
;; 初期化スクリプトの分離.
;; 下記ディレクトリ内にあるファイルを /etc/init.d と同じ方式で順番に実行するので
;; 依存関係のある初期化を順番どうりに実行できる.
(let* ((dir "~/.emacs.d/init.d")
(el-suffix "\\.el\\'")
(files (mapcar
(lambda (path) (replace-regexp-in-string el-suffix "" path))
(directory-files dir t el-suffix))))
(while files
(load (car files))
(setq files (cdr files))))
;; ロードパス追加(~/.emacs.d)
(add-to-list 'load-path "~/.emacs.d")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; installer
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; http://d.hatena.ne.jp/rubikitch/20070726/1186048104
(when (locate-library "install-elisp")
(require 'install-elisp)
(setq install-elisp-repository-directory "~/.emacs.d/"))
;; (install-elisp-from-emacswiki "auto-install.el")
;; Emacs テクニックバイブルより
;; Emacs インストーラー, install-elisp の後継
(when (locate-library "auto-install")
(require 'auto-install)
(add-to-list 'load-path auto-install-directory)
(auto-install-update-emacswiki-package-name t)
(auto-install-compatibility-setup)
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
)
;;; 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.
;; (install-elisp "http://tromey.com/elpa/package-install.el")
;; Emacs テクニックバイブルより
;; Emacs パッケージマネージャー, auto-install と補完しあうもの
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(package-initialize))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; documentation
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'Info-default-directory-list "~/.emacs.d/share/info/")
(add-hook 'Info-mode-hook
(lambda () (setq Info-additional-directory-list Info-default-directory-list)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; font
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NTEmacs (emacs 22.x) =>
;; 日本語文字: モトヤシーダまたはモトヤアポロを用意してください.
;; 英文字: consolas を用意してください.(Vista はデフォルトで入ってます. XP は microsoft からダウンロードしてください.)
;; NTEmacs (emacs 23.x) =>
;; 日本語文字: TakaoGothic(https://launchpad.net/takao-fonts/+download)
;; 英文字: Inconsolata(http://www.levien.com/type/myfonts/inconsolata.html)
;; GNU Emacs 23.x on unix =>
;; ~/.Xresources にて日本語フォントを設定してください.
(cond
(run-gnu-emacs-22-w32
(require 'ntemacs-font)
(setq ntemacs-font-encode-family-list-motoya
'((ascii . "Consolas")
(latin-iso8859-1 . "Lucida Console*")
(japanese-jisx0208 . "*モトヤシータ゛1等幅")
(katakana-jisx0201 . "*モトヤシータ゛1等幅")
(chinese-gb2312 . "Arial Unicode MS*")
(chinese-big5-1 . "Arial Unicode MS*")
(korean-ksc5601 . "Arial Unicode MS*")
(mule-unicode-0100-24ff . "Arial Unicode MS*")
(mule-unicode-e000-ffff . "Arial Unicode MS*")))
(fixed-width-create-fontset "motoya" ntemacs-font-defined-sizes ntemacs-font-encode-family-list-motoya)
(fixed-width-set-fontset "motoya" 14))
(run-gnu-emacs-23-w32
(set-default-font "Inconsolata-10")
(set-fontset-font (frame-parameter nil 'font)
'japanese-jisx0208
'("TakaoGothic" . "unicode-bmp"))
(set-fontset-font (frame-parameter nil 'font)
'katakana-jisx0201
'("TakaoGothic" . "unicode-bmp"))
)
(run-gnu-emacs-22-unix
)
(run-gnu-emacs-23-unix
)
(t
(set-default-font "VL Gothic-8")
(set-fontset-font (frame-parameter nil 'font)
'japanese-jisx0208
'("VL Gothic" . "unicode-bmp")))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; IME
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(cond
(run-gnu-emacs-23-w32
(setq default-input-method "W32-IME")
(w32-ime-initialize)
(set-cursor-color "red")
(setq w32-ime-buffer-switch-p nil)
(add-hook 'input-method-activate-hook
(lambda() (set-cursor-color "green")))
(add-hook 'input-method-inactivate-hook
(lambda() (set-cursor-color "red")))
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; key bindings
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; M-x auto-install-batch sequential-command
;; Emacs テクニックバイブルより
;; 同じコマンドを連続実行したときの振る舞いを変更する
(when (locate-library "sequential-command.el")
(require 'sequential-command-config)
(sequential-command-setup-keys))
(global-set-key (kbd "C-h") 'delete-backward-char) ; BackSpace相当(shellに合わせる)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; frame
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 初期フレーム ------------------------------------------------------
;; 色を変えるときは M-x list-colors-display で確認してください.
(cond
(run-gnu-emacs
(if (and run-w32 run-emacs22)
(set-alpha '(75 20)))
(setq default-frame-alist
(append (list '(foreground-color . "white")
'(background-color . "black"))
default-frame-alist)))
)
;; ツールバー & スクロールバー ------------------------------
(cond
(run-gnu-emacs-23-w32
(tool-bar-mode -1) ; ツールバーなし
(scroll-bar-mode -1) ; スクロールバーなし
))
;; フレームタイトル -----------------------------------------
(setq frame-title-format "%b") ; ファイル名表示
;; モードライン ---------------------------------------------
;; 時刻表示
(setq display-time-string-forms
'((substring year -2) "/" month "/" day " " 24-hours ":" minutes))
(display-time)
;; 行/桁表示
(line-number-mode 1)
(column-number-mode 1)
;; Isearch を表示しない
(add-hook 'isearch-mode-hook
'(lambda () (setcar (cdr (assq 'isearch-mode minor-mode-alist)) "")))
;; Texinfo を短く
(add-hook 'texinfo-mode-hook
'(lambda () (setq mode-name "Texi")))
;; Lisp Interaction を短く
(add-hook 'lisp-interaction-mode-hook
'(lambda () (setq mode-name "LispInt")))
;; Emacs-Lisp を短く
(add-hook 'emacs-lisp-mode-hook
'(lambda () (setq mode-name "Elisp")))
;; 起動画面 --------------------------------------------------
(setq inhibit-startup-message t) ; なし
;; その他いろいろ --------------------------------------------
(global-hl-line-mode 1) ; 現在行に色づけ
(show-paren-mode t) ; 対応する括弧をハイライト
(setq gc-cons-threshold (* 10 gc-cons-threshold)) ; GCを減らして動作を軽くする
(setq message-log-max 10000) ; ログ記録行数を 10000 に
(setq enable-recursive-minibuffers t) ; ミニバッファを再帰的に呼び出せるようにする
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; regexp / search
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; c/migemo ------------------------------------------------------
;; http://www.kaoriya.net/#CMIGEMO
;;
;; (when (locate-library "migemo")
;; (setq migemo-command "cmigemo") ; cmigemo を使っている場合の設定です
;; (setq migemo-options '("-q" "--emacs"))
;; (setq migemo-dictionary
;; (if run-w32
;; (expand-file-name (concat site-data-directory "migemo/cp932/migemo-dict"))
;; (expand-file-name (concat site-data-directory "migemo/euc-jp/migemo-dict"))))
;; (setq migemo-user-dictionary nil)
;; (setq migemo-regex-dictionary nil)
;; (setq migemo-use-pattern-alist t)
;; (setq migemo-use-frequent-pattern-alist t)
;; (setq migemo-pattern-alist-length 1024)
;; (if run-w32 (setq migemo-coding-system 'japanese-shift-jis-unix))
;; (require 'migemo)
;; (migemo-init))
;; GNU GLOBAL(gtags) ---------------------------------------------
(when (locate-library "gtags")
(require 'gtags)
(global-set-key "\M-t" 'gtags-find-tag) ; 関数定義元へ
(global-set-key "\M-r" 'gtags-find-rtag) ; 関数の参照元へ
(global-set-key "\M-s" 'gtags-find-symbol) ; 変数へ(うまくうごかない...)
(global-set-key "\M-p" 'gtags-find-pattern) ; マッチした行へ
(global-set-key "\M-f" 'gtags-find-file) ; マッチしたファイル名へ
(global-set-key [?\C-,] 'gtags-pop-stack) ; ジャンプ前の場所へ
(add-hook 'c-mode-common-hook '(lambda () (gtags-mode 1)))
(setq gtags-mode-hook '(lambda () (setq gtags-path-style 'relative)))
;; http://d.hatena.ne.jp/rubikitch/20080304/gtagscurrentline
(defun gtags-current-line ()
(save-excursion
(save-restriction
(widen)
(forward-char 1)
(count-lines (point-min) (point)))))
(defadvice gtags-goto-tag (around show-current-position activate)
"Point to the entry of current file/line."
(let ((bfn buffer-file-name)
(curline (gtags-current-line)))
ad-do-it
(when (and bfn (eq major-mode 'gtags-select-mode))
(let ((path (if (looking-at "[^ \t]+[ \t]+[0-9]+[ \t]/[^ \t]+[ \t]")
bfn
(file-relative-name bfn))))
(and (or (re-search-forward (format "%d[ \t]+%s" curline (regexp-quote path)) nil t)
(search-forward path nil t))
(beginning-of-line))))))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; region
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq transient-mark-mode t) ; 色あり
(setq highlight-nonselected-windows t) ; バッファを切り替えても色がついた状態保持
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; buffer switching
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; anything ------------------------------------------------------
(when (locate-library "anything")
(require 'anything-startup)
)
;; iswitchb は anything と相性が悪いのでやめました 2011.02.25
;; ido-mode もいったんやめました 2011.02.25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; save/load file
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; saveplace.el
;; ファイルを保存したときに前回編集していた場所を記憶する
(load "saveplace")
(setq-default save-place t)
;; recentf
(require 'recentf)
(recentf-mode 1)
;; desktop
(desktop-save-mode 1)
;; (install-elisp-from-emacswiki "auto-async-byte-compile.el")
;; Emacs テクニックバイブルより
;; ファイルを保存したときに自動的にバイトコンパイルする
(when (locate-library "auto-async-byte-compile")
(require 'auto-async-byte-compile)
(setq auto-async-byte-compile-exclude-files-regexp "/junk/")
(add-hook 'emacs-lisp-mode-hook 'enable-auto-async-byte-compile-mode)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; templates
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; auto-complete -------------------------------------------------
(when (locate-library "auto-complete-extension")
(require 'auto-complete-extension)
(global-auto-complete-mode t)
(define-key ac-complete-mode-map "\t" 'ac-complete)
(setq ac-auto-start t)
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer ac-source-gtags ac-source-filename))
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(make-local-variable 'ac-sources)
(setq ac-sources '(ac-source-yasnippet ac-source-abbrev ac-source-words-in-buffer ac-source-symbols))))
(defconst c++-keywords
(sort
(list "and" "bool" "compl" "do" "export" "goto" "namespace" "or_eq" "return"
"struct" "try" "using" "xor" "and_eq" "break" "const" "double" "extern"
"if" "new" "private" "short" "switch" "typedef" "virtual" "xor_eq" "asm"
"case" "const_cast" "dynamic_cast" "false" "inline" "not" "protected"
"signed" "template" "typeid" "void" "auto" "catch" "continue" "else"
"float" "int" "not_eq" "public" "sizeof" "this" "typename" "volatile"
"bitand" "char" "default" "enum" "for" "long" "operator" "register"
"static" "throw" "union" "wchar_t" "bitor" "class" "delete" "explicit"
"friend" "mutable" "or" "reinterpret_cast" "static_cast" "true"
"unsigned" "while") #'(lambda (a b) (> (length a) (length b)))))
(defvar ac-source-c++
'((candidates
. (lambda ()
(all-completions ac-target c++-keywords))))
"Source for c++ keywords.")
(add-hook 'c++-mode-hook
(lambda ()
(make-local-variable 'ac-sources)
(setq ac-sources '(ac-source-c++))))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; external utilities
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; emacsclient
;(server-start)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; programming
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; C/C++ ---------------------------------------------------------
(add-hook 'c-mode-common-hook
'(lambda () ; style
(c-set-style "linux")))
(setq auto-mode-alist
(cons '("\\.h$" . c++-mode) auto-mode-alist))
;; from http://www.emacswiki.org/emacs/CPlusPlusMode
;; 標準 C++ ライブラリを font-lock する設定
(require 'cl)
(defun file-in-directory-list-p (file dirlist)
"Returns true if the file specified is contained within one of
the directories in the list. The directories must also exist."
(let ((dirs (mapcar 'expand-file-name dirlist))
(filedir (expand-file-name (file-name-directory file))))
(and
(file-directory-p filedir)
(member-if (lambda (x) ; Check directory prefix matches
(string-match (substring x 0 (min(length filedir) (length x))) filedir))
dirs))))
(defun buffer-standard-include-p ()
"Returns true if the current buffer is contained within one of
the directories in the INCLUDE environment variable."
(and (getenv "INCLUDE")
(file-in-directory-list-p buffer-file-name (split-string (getenv "INCLUDE") path-separator))))
(add-to-list 'magic-fallback-mode-alist '(buffer-standard-include-p . c++-mode))
;; ruby ----------------------------------------------------------
(when (locate-library "ruby-mode")
(require 'ruby-mode)
(setq auto-mode-alist
(cons '("\\.rb$" . ruby-mode) auto-mode-alist)))
;; emacs-rails ---------------------------------------------------
(when (locate-library "rails")
(add-to-list 'load-path "~/.emacs.d/emacs-rails-0.5.99.5")
(require 'rails))
;; css-mode ------------------------------------------------------
(when (locate-library "css-mode")
(autoload 'css-mode "css-mode")
(setq auto-mode-alist
(cons '("\\.css\\'" . css-mode) auto-mode-alist))
(setq cssm-indent-function #'cssm-c-style-indenter))
;; lua -----------------------------------------------------------
(when (locate-library "lua-mode")
(setq auto-mode-alist (cons '("\\.lua$" . lua-mode) auto-mode-alist))
(autoload 'lua-mode "lua-mode" "Lua editing mode." t))
;; doxymacs ------------------------------------------------------
(when (locate-library "doxymacs")
(require 'doxymacs)
(add-hook 'c-mode-common-hook 'doxymacs-mode)
(defun my-doxymacs-font-lock-hook ()
(if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
(doxymacs-font-lock)))
(add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
)
;; PHP ------------------------------------------------------
(when (locate-library "php-mode")
(require 'php-mode)
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(setq php-mode-force-pear t)
(add-hook 'php-mode-hook
'(lambda ()
(setq indent-tabs-mode t)
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-offset 4)
(setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80))
(setq php-manual-path "/usr/local/share/php/doc/html")
(setq php-manual-url "http://www.phppro.jp/phpmanual/")))
)
(when (locate-library "smarty-mode")
(require 'smarty-mode)
(setq auto-mode-alist
(append
'(("\\.tpl$" . smarty-mode))
auto-mode-alist))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; no categorize
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; sdic
(autoload 'sdic-describe-word "sdic" "英単語の意味を調べる" t nil)
(autoload 'sdic-describe-word-at-point "sdic" "カーソル位置の英単語の意味を調べる" t nil)
(global-set-key "\C-cw" 'sdic-describe-word)
(setq sdic-window-height 10
sdic-disable-select-window t)
(setq sdic-eiwa-dictionary-list '((sdicf-client "~/.emacs.d/share/dict/gene.sdic")))
(setq sdic-waei-dictionary-list '((sdicf-client "~/.emacs.d/share/dict/jedict.sdic")))
;; git by egg.el
;(when (locate-library "egg") (require 'egg))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; experimental
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; yasnippet
(when (locate-library "yasnippet")
(require 'yasnippet)
(global-set-key (kbd "C-c y") 'anything-c-yas-complete)
(yas/initialize)
(yas/load-directory (concat site-data-directory "snippets"))
(add-to-list 'yas/extra-mode-hooks 'ruby-mode-hook)
(add-to-list 'yas/extra-mode-hooks 'c-mode-common-hook))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; applications
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; twittering-mode
;; (when (locate-library "~/.emacs.d/twittering-mode-1.0.0/twittering-mode.el")
;; (add-to-list 'load-path "~/.emacs.d/twittering-mode-1.0.0")
;; (require 'twittering-mode)
;; (setq twittering-auth-method 'xauth)
;; (setq twittering-username "yagihiro")
;;)
;;; 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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment