root/dotfiles/emacs/hsbt-emacs @ 14813

Revision 14425, 3.4 kB (checked in by hsbt, 6 years ago)

recent updates.

Line 
1(add-to-list 'load-path "~/.emacs.d/plugins")
2(add-to-list 'load-path "~/.emacs.d/emacs-rails")
3
4;; syntax highlight
5(require 'font-lock)
6(global-font-lock-mode t)
7(setq font-lock-support-mode 'jit-lock-mode)
8
9(require 'yasnippet)
10(yas/initialize)
11(yas/load-directory "~/.emacs.d/snippets")
12
13;; ruby-mode
14(require 'ruby-mode)
15(autoload 'ruby-mode "ruby-mode"
16  "Mode for editing ruby source files" t)
17(autoload 'run-ruby "inf-ruby"
18  "Run an inferior Ruby process")
19(autoload 'inf-ruby-keys "inf-ruby"
20  "Set local key defs for inf-ruby in ruby-mode")
21(add-hook 'ruby-mode-hook
22          '(lambda ()
23            (inf-ruby-keys)
24            (setq tab-width 3)
25            (setq indent-tabs-mode 't)
26            (setq ruby-indent-level tab-width)
27            (setq ruby-deep-indent-paren-style nil)))
28(setq auto-mode-alist
29      (append '(("\\.rb$" . ruby-mode)
30                ("\\.rhml$" . ruby-mode)
31                ) auto-mode-alist))
32(setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
33                                     interpreter-mode-alist))
34
35;; ruby-electric
36(require 'ruby-electric)
37(add-hook 'ruby-mode-hook '(lambda () (ruby-electric-mode t)))
38
39;; rails
40(defun try-complete-abbrev (old)
41  (if (expand-abbrev) t nil))
42(setq hippie-expand-try-functions-list
43      '(try-complete-abbrev
44        try-complete-file-name
45        try-expand-dabbrev))
46(setq rails-use-mongrel t)
47(require 'cl)
48(require 'rails)
49
50;; ruby-block
51;(require 'ruby-block)
52;(ruby-block-mode t)
53;(setq ruby-block-highlight-toggle t)
54
55;; recentf
56(recentf-mode)
57
58;; dabbrev-expand
59(global-set-key "\C-o" 'dabbrev-expand)
60
61;; auto-save-buffers
62(require 'auto-save-buffers)
63(run-with-idle-timer 0.5 t 'auto-save-buffers)
64(progn
65  (setq auto-save-list-file-name nil)
66  (setq auto-save-list-file-prefix nil)
67  (setq make-backup-files nil))
68
69;;
70(cond (window-system
71       (setq x-select-enable-clipboard t)
72       ))
73
74;; utf-8
75(require 'un-define)
76(require 'jisx0213)
77(set-language-environment "Japanese")
78(set-default-coding-systems 'utf-8)
79(set-terminal-coding-system 'utf-8)
80(set-keyboard-coding-system 'utf-8)
81(set-buffer-file-coding-system 'utf-8)
82(setq default-buffer-file-coding-system 'utf-8)
83
84;; grep
85(if (file-exists-p "/usr/bin/lgrep")
86    (setq grep-command "lgrep -n ")
87)
88
89;; Input Method Editor
90;(setq default-input-method "japanese-prime")
91;(toggle-input-method nil)
92
93;; ref dotfiles/emacs/tokuhirom-emacs
94;;; yes,no を答えるかわりに,y,n にする
95(fset 'yes-or-no-p 'y-or-n-p)
96
97;;; カーソルが行頭にあるときに,C-k 1回で その行全体を削除
98(setq kill-whole-line t)
99
100;;; 起動直後の *scratch* buffer に入る文字列をなくす
101(setq initial-scratch-message nil)
102
103;;; startup message を消す
104(setq inhibit-startup-message t)
105
106;; .gz なファイルを読めるように
107(auto-compression-mode t)
108
109;;; shell-mode で ^M を出さなくする.
110(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m nil t)
111
112;;; ステータスラインに時間を表示する
113(progn
114  (setq display-time-24hr-format t)
115  (setq display-time-format "%Y-%m-%d(%a) %H:%M")
116  (setq display-time-day-and-date t)
117  (setq display-time-interval 30)
118  (display-time))
119
120;; .h なファイルは C++-mode で.
121(setq auto-mode-alist
122      (cons (cons "\\.h$" 'c++-mode)
123            auto-mode-alist))
124
125;; .svn は補完対象から外す
126(add-to-list 'completion-ignored-extensions ".svn/")
127;; 補完は ignore-case で。
128(setq completion-ignore-case t)
129
130;; elscreen
131(require 'elscreen)
Note: See TracBrowser for help on using the browser.