Skip to content

Instantly share code, notes, and snippets.

@ainame
Created September 5, 2011 14:39
Show Gist options
  • Save ainame/1195141 to your computer and use it in GitHub Desktop.
Save ainame/1195141 to your computer and use it in GitHub Desktop.
自分の.emacsからruby-mode周りを抜いた物
;;; Time-stamp: <2011-07-22 18:05:48 namai>
;;;
(add-to-list 'load-path "~/.emacs.d/elisp/")
;; auto-install
(setq auto-install-directory "~/.emacs.d/auto-install/")
(add-to-list 'load-path auto-install-directory)
(add-to-list 'load-path (expand-file-name "~/.emacs.d/auto-install"))
;;(add-to-list 'custom-theme-load-path "~/.emacs.d/elisp/")
(require 'auto-install)
;;(auto-install-update-emacswiki-package-name t)
;(auto-install-compatibility-setup)
;(setq ediff-window-setup-function 'ediff-setup-window-plain)
;; C-h
(global-set-key (kbd "C-h") 'delete-backward-char)
;; forward-word
;;(global-set-key (kbd "C-f") 'forward-word)
;;(global-set-key (kbd "C-b") 'backward-word)
;; *scratch*のメッセージを消す
(setq initial-scratch-message nil)
;;; ホイールマウス
(mouse-wheel-mode t)
(setq mouse-wheel-follow-mouse t)
;;; 対応する括弧を光らせる。
(show-paren-mode 1)
;;; バックアップファイルを作らない
(setq backup-inhibited t)
;;; 終了時にオートセーブファイルを消す
(setq delete-auto-save-files t)
;;; emacs -nw で起動した時にメニューバーを消す
(if window-system (menu-bar-mode 1) (menu-bar-mode -1))
;;; 現在の関数名をモードラインに表示
(which-function-mode 1)
;;; Time stamp
;;; ファイルの中で最初に表れる「Last modified:」という文字列が
;;; あったらそこに「曜日 月 日 時間 年 タイムゾーン」の順にタイムスタンプ
(require 'time-stamp)
;; (if (not (memq 'time-stamp write-file-hooks))
;; (setq write-file-hooks
;; (cons 'time-stamp write-file-hooks)))
;; Interactively Do Things (highly recommended, but not strictly required)
(require 'ido)
(ido-mode t)
;;shell-mode
(require 'multi-term)
(setq multi-term-program shell-file-name)
;;(add-to-list 'term-unbind-key-list '"M-x")
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(global-set-key (kbd "C-c t") '(lambda ()
(interactive)
(multi-term)))
(require 'shell-pop)
;; multi-term に対応
(add-to-list 'shell-pop-internal-mode-list '("multi-term" "*terminal<1>*" '(lambda () (multi-term))))
(shell-pop-set-internal-mode "multi-term")
;; 25% の高さに分割する
(shell-pop-set-window-height 50)
(shell-pop-set-internal-mode-shell shell-file-name)
;; ショートカットも好みで変更してください
(global-set-key (kbd "C-x t") 'shell-pop)
(put 'downcase-region 'disabled nil)
;; dired-x
(require 'dired-x)
;; リネームが便利にwdired
(require 'wdired)
(define-key dired-mode-map "r" 'wdired-change-to-wdired-mode)
;; termでバッファ間の共有がしたい
;; (add-hook 'term-mode-hook '(lambda ()
;; (define-key term-raw-map "\C-y" 'term-paste)
;; (define-key term-raw-map "\C-q" 'move-beginning-of-line)
;; (define-key term-raw-map "\C-r" 'term-send-raw)
;; (define-key term-raw-map "\C-s" 'term-send-raw)
;; (define-key term-raw-map "\C-f" 'forward-char)
;; (define-key term-raw-map "\C-b" 'backward-char)
;; (define-key term-raw-map "\C-t" 'set-mark-command)
;; (define-key term-raw-map (kbd "ESC") 'term-send-raw)
;; (define-key term-raw-map [delete] 'term-send-raw)
;; (define-key term-raw-map "\C-z"
;; (lookup-key (current-global-map) "\C-z"))))
;;; バックアップファイルを作らない
(setq backup-inhibited t)
;;; 終了時にオートセーブファイルを消す
(setq delete-auto-save-files t)
(load "dark-theme")
;; cperl-mode
(defalias 'perl-mode 'cperl-mode)
(setq auto-mode-alist (cons '("\\.t$" . cperl-mode) auto-mode-alist))
(add-hook 'cperl-mode-hook
(function (lambda ()
(set-face-background 'cperl-hash-face "black")
(set-face-background 'cperl-array-face "black")
)))
;; cmigemo
(require 'migemo)
(setq migemo-command "cmigemo")
(setq migemo-options '("-q" "--emacs"))
(setq migemo-dictionary "/usr/local/share/migemo/utf-8/migemo-dict")
(setq migemo-user-dictionary nil)
(setq migemo-regex-dictionary nil)
(setq migemo-coding-system 'utf-8-unix)
(load-library "migemo")
(migemo-init)
(set-process-query-on-exit-flag migemo-process nil)
;; anything.el
(require 'anything)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment