(add-to-list 'load-path "~/.emacs.d/plugins") (add-to-list 'load-path "~/.emacs.d/emacs-rails") ;; syntax highlight (require 'font-lock) (global-font-lock-mode t) (setq font-lock-support-mode 'jit-lock-mode) (require 'yasnippet) (yas/initialize) (yas/load-directory "~/.emacs.d/snippets") ;; ruby-mode (require 'ruby-mode) (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t) (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process") (autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in ruby-mode") (add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys) (setq tab-width 3) (setq indent-tabs-mode 't) (setq ruby-indent-level tab-width) (setq ruby-deep-indent-paren-style nil))) (setq auto-mode-alist (append '(("\\.rb$" . ruby-mode) ("\\.rhml$" . ruby-mode) ) auto-mode-alist)) (setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) interpreter-mode-alist)) ;; ruby-electric (require 'ruby-electric) (add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t))) ;; rails (defun try-complete-abbrev (old) (if (expand-abbrev) t nil)) (setq hippie-expand-try-functions-list '(try-complete-abbrev try-complete-file-name try-expand-dabbrev)) (setq rails-use-mongrel t) (require 'cl) (require 'rails) ;; ruby-block ;(require 'ruby-block) ;(ruby-block-mode t) ;(setq ruby-block-highlight-toggle t) ;; recentf (recentf-mode) ;; dabbrev-expand (global-set-key "\C-o" 'dabbrev-expand) ;; auto-save-buffers (require 'auto-save-buffers) (run-with-idle-timer 0.5 t 'auto-save-buffers) (progn (setq auto-save-list-file-name nil) (setq auto-save-list-file-prefix nil) (setq make-backup-files nil)) ;; (cond (window-system (setq x-select-enable-clipboard t) )) ;; utf-8 (require 'un-define) (require 'jisx0213) (set-language-environment "Japanese") (set-default-coding-systems 'utf-8) (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) ;; grep (if (file-exists-p "/usr/bin/lgrep") (setq grep-command "lgrep -n ") ) ;; Input Method Editor ;(setq default-input-method "japanese-prime") ;(toggle-input-method nil) ;; ref dotfiles/emacs/tokuhirom-emacs ;;; yes,no を答えるかわりに,y,n にする (fset 'yes-or-no-p 'y-or-n-p) ;;; カーソルが行頭にあるときに,C-k 1回で その行全体を削除 (setq kill-whole-line t) ;;; 起動直後の *scratch* buffer に入る文字列をなくす (setq initial-scratch-message nil) ;;; startup message を消す (setq inhibit-startup-message t) ;; .gz なファイルを読めるように (auto-compression-mode t) ;;; shell-mode で ^M を出さなくする. (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t) ;;; ステータスラインに時間を表示する (progn (setq display-time-24hr-format t) (setq display-time-format "%Y-%m-%d(%a) %H:%M") (setq display-time-day-and-date t) (setq display-time-interval 30) (display-time)) ;; .h なファイルは C++-mode で. (setq auto-mode-alist (cons (cons "\\.h$" 'c++-mode) auto-mode-alist)) ;; .svn は補完対象から外す (add-to-list 'completion-ignored-extensions ".svn/") ;; 補完は ignore-case で。 (setq completion-ignore-case t) ;; elscreen (require 'elscreen)