Created
October 8, 2010 10:22
-
-
Save rummelonp/616600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; add .emacs to load path | |
(add-to-list 'load-path "~/.emacs.d") | |
(add-to-list 'load-path "~/.emacs.d/elisp") | |
;; language | |
(set-language-environment "Japanese") | |
(prefer-coding-system 'utf-8) | |
(setq file-name-coding-system 'utf-8) | |
(setq locale-coding-system 'utf-8) | |
;; display | |
;; 現在の行のハイライト | |
(setq hl-line-face '(:background "darkolivegreen" t)) | |
(global-hl-line-mode t) | |
;; 行とカラムの表示 | |
(line-number-mode t) | |
(column-number-mode t) | |
;; el screen | |
;; $ curl -O ftp://ftp.morishima.net/pub/morishima.net/naoto/ElScreen/elscreen-1.4.6.tar.gz | |
;; $ tar -xvf elscreen-1.4.6.tar.gz | |
;; $ cp elscreen-1.4.6/elscreen.el ~/.emacs.d/elisp/ | |
;; (when (require 'elscreen nil t) | |
;; (if window-system | |
;; (define-key elscreen-map (kbd "C-z") 'iconify-or-deiconify-frame) | |
;; (define-key elscreen-map (kbd "C-z") 'suspend-emacs))) | |
;; tab | |
(setq-default tab-width 2) | |
(setq-default indent-tabs-mode nil) | |
;; paren | |
;; 括弧のハイライトの設定 | |
(show-paren-mode t) | |
(setq show-paren-delay 0) | |
(setq show-paren-style 'expression) | |
(set-face-background 'show-paren-match-face nil) | |
(set-face-underline-p 'show-paren-match-face t) | |
;; key | |
;; 改行してインデント | |
(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))) | |
;; 次のウィンドウに移動、ウィンドウがひとつなら新しく作って移動 | |
(defun other-window-or-split () | |
(interactive) | |
(when (one-window-p) | |
(split-window-horizontally)) | |
(other-window 1)) | |
(define-key global-map (kbd "RET") 'newline-and-indent) | |
(define-key global-map (kbd "TAB") 'indent-and-back-to-indentation) | |
(define-key global-map (kbd "C-j") 'indent-new-comment-line) | |
(define-key global-map (kbd "C-h") 'delete-backward-char) | |
(define-key global-map (kbd "C-t") 'other-window-or-split) | |
(define-key global-map (kbd "C-M-_") 'redo) | |
(define-key global-map (kbd "C-M-v") 'scroll-down) | |
(define-key global-map (kbd "M-%") 'replace-regexp) | |
(define-key global-map (kbd "M-!") 'multi-term) | |
(define-key global-map (kbd "M-o") 'occur-by-moccur) | |
(define-key global-map (kbd "M-k") 'kill-this-buffer) | |
(define-key global-map (kbd "M-p") 'point-undo) | |
(define-key global-map (kbd "M-n") 'point-redo) | |
(define-key global-map (kbd "M-t") 'delete-window) | |
(define-key global-map (kbd "<f5>") (kbd "C-x h C-i")) | |
;; buffer | |
;; 正規表現でバッファ切り替え出来るようにする | |
(iswitchb-mode t) | |
(setq read-buffer-function 'iswitchb-read-buffer) | |
(setq iswitchb-regexp t) | |
(setq iswitchb-prompt-newbuffer t) | |
;; file | |
;; 自動保存/バックアップファイルを削除 | |
(setq save-place t) | |
(setq require-final-newline t) | |
(setq kill-whole-line t) | |
(setq backup-inhibited t) | |
(setq delete-auto-save-files t) | |
;; uniquify | |
;; フォルダ名もバッファ名に含める | |
(require 'uniquify) | |
(setq uniquify-buffer-name-style 'point0forward-angle-brackets) | |
(setq uniquify-ignore-buffers-re "*[^*]+*") | |
;; recentf | |
;; 最近開いたファイルの保存 | |
(require 'recentf) | |
(setq recentf-max-save-items 100) | |
(setq recentf-exclude '("/TAGS$" "/var/tmp/")) | |
;; wdired | |
;; diredモードでファイル名を編集出来るように | |
(require 'wdired) | |
(define-key dired-mode-map "r" 'wdired-change-to-wdired-mode) | |
;; tramp | |
;; sshでリモートサーバのファイルを編集 | |
(require 'tramp) | |
(setq tramp-default-method "sshx") | |
;; multi term | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/multi-term.el") | |
;; emacsからbashを使えるように | |
(when (require 'multi-term nil t) | |
(setq multi-term-program "/bin/bash")) | |
;; egg | |
;; (install-elisp "http://github.com/byplayer/egg/raw/master/egg.el") | |
;; emacsからgitを使えるように | |
(require 'egg) | |
;; share clipboard for max os x | |
;; キリングとクリップボードを共有 | |
(defun copy-from-osx () | |
(shell-command-to-string "pbpaste")) | |
(defun paste-to-osx (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) | |
(setq interprogram-cut-function 'paste-to-osx) | |
(setq interprogram-paste-function 'copy-from-osx) | |
;; auto-install | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/auto-install.el") | |
(when (require 'auto-install nil t) | |
;; directory setting | |
(setq auto-install-directory "~/.emacs.d/elisp/") | |
;; get elisp name of registerd in EmacsWiki | |
;; (auto-install-update-emacswiki-package-name t) | |
;; setup "install-elisp" function | |
(auto-install-compatibility-setup)) | |
;; color-moccur and moccur edit | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/color-moccur.el") | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/moccur-edit.el") | |
;; 検索結果をリストアップ | |
(when (require 'color-moccur nil t) | |
(setq moccur-split-word t) | |
(add-to-list 'dmoccur-exclusion-mask "\\.DS_Store") | |
(add-to-list 'dmoccur-exclusion-mask "^#.+#$") | |
(require 'moccur-edit)) | |
;; grep edit | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/grep-edit.el") | |
;; grep結果を編集可能に | |
(require 'grep-edit) | |
;; redo+ | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/redo+.el") | |
;; redo出来るように | |
(require 'redo+) | |
;; undohist | |
;; (install-elisp "http://cx4a.org/pub/undohist.el") | |
;; ファイル履歴のundo | |
(when (require 'undohist nil t) | |
(undohist-initialize)) | |
;; undo-tree | |
;; (install-elisp "http://www.dr-qubit.org/undo-tree/undo-tree.el") | |
;; undo/redoを便利に | |
(when (require 'undo-tree nil t) | |
(global-undo-tree-mode)) | |
;; point-undo | |
;; (install-elisp "http://www.emacswiki.org/cgi-bin/wiki/download/point-undo.el") | |
;; ポインタ位置を記録 | |
(require 'point-undo) | |
;; auto complete | |
;; $ cd | |
;; $ curl -O http://cx4a.org/pub/auto-complete/auto-complete-1.3.tar.bz2 | |
;; $ tar -xvf auto-complete-1.3.tar.bz2 | |
;; M-x load-file RET ~/auto-complete-1.3/etc/install.el RET | |
;; 自動補完機能 | |
(when (require 'auto-complete-config nil t) | |
(add-to-list 'ac-dictionary-directories "~/.emacs.d/elisp/ac-dict") | |
(ac-config-default)) | |
;; lisp mode | |
(defun emacs-lisp-ac-setup () | |
(setq ac-sources'(ac-source-words-in-same-mode-buffers ac-source-symbols))) | |
(add-hook 'emacs-lisp-mode-hook 'emacs-lisp-ac-setup) | |
;; paredit | |
;; (install-elisp "http://mumble.net/~campbell/emacs/paredit.el") | |
;; 対になる括弧を自動挿入 | |
(require 'paredit) | |
(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode) | |
(add-hook 'lisp-interaction-mode-hook 'enable-paredit-mode) | |
(add-hook 'lisp-mode-hook 'enable-paredit-mode) | |
(add-hook 'ielm-mode-hook 'enable-paredit-mode) | |
;; eldoc | |
;; (install-elisp "http://www.emacswiki.org/emacs/download/eldoc-extension.el") | |
(require 'eldoc-extension) | |
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) | |
(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) | |
(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) | |
;; js2 mode | |
;; (install-elisp "http://js2-mode.googlecode.com/files/js2-20090723b.el") | |
(when (require 'js2-mode nil t) | |
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | |
(setq js2-bounce-indent-flag nil | |
js2-basic-offset 2) | |
(define-key js2-mode-map "\C-m" 'newline-and-indent) | |
(define-key js2-mode-map "\C-i" 'indent-and-back-to-indentation)) | |
;; php mode | |
;; (install-elisp "http://php-mode.svn.sourceforge.net/svnroot/php-mode/tags/php-mode-1.5.0/php-mode.el") | |
(require 'php-mode) | |
;; ruby mode | |
;; (install-elisep "http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/ruby-mode.el?view=co") | |
(require 'ruby-mode) | |
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode)) | |
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) | |
;; (install-elisp "http://github.com/hayamiz/twittering-mode/raw/master/twittering-mode.el") | |
(require 'twittering-mode) | |
(setq twittering-status-format "%C{%Y/%m/%d %H:%M:%S} %s > %T > from %f%L%r%R") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment