さくらインターネットのレンタルサーバ(月々500円)では、SSHで接続できる。
http://support.sakura.ad.jp/support/manual/rs/tech_ssh.shtml
2009年11月現在、FreeBSD7.1の環境で、最初からEmacs22.3が入っている。
だがEmacs22なので、ruby-modeは同梱されていない。(Emacs23なら同梱されているのだが)
ruby-modeは、Rubyの公式サイトで入手できる。
具体的にはソースコードのmisc/ 以下に入っている。ここにある *.el ファイル全部取得する。
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/misc/
ソースコードをすべてダウンロードしても取り出してもよいし、
そのWebページで [最新リビジョン番号をクリック→Download] で取得してもいい。
今回は、~/local/site-lispに入れた。
itouhiro@www731 site-lisp> cd ~/local/site-lisp/ itouhiro@www731 site-lisp> ls ./ rename.txt ruby-style.el ../ ruby-electric.el rubydb2x.el inf-ruby.el ruby-mode.el rubydb3x.el itouhiro@www731 site-lisp>
そのあとで、Emacs設定ファイルで読み込むように指定すると、ruby-modeが使える。
SSHクライアントには、putty(英語版)を使った。
puttyの設定で、UTF-8 に指定しておけば日本語も、文字幅はともかく、なんとか表示・入力できる。
Emacs設定ファイルはこんなところ。
~/.emacs22
;; -*- mode: lisp-interaction; syntax: elisp -*- ;; Time-stamp: <Nov 22 2009> ;;; ;;; 文字コード/地域の設定 ;;; (set-language-environment "Japanese") (set-default-coding-systems 'utf-8-unix) (set-buffer-file-coding-system 'utf-8-unix) (set-keyboard-coding-system 'utf-8-unix) ;(set-clipboard-coding-system 'utf-8-unix) ;(prefer-coding-system 'cp932-dos) (set-terminal-coding-system 'utf-8-unix) ;; U+0080 - U+2E7F の文字を CJKにデコード (utf-translate-cjk-set-unicode-range '((#x00a2 . #x00a3) ; ¢, £ (#x00a7 . #x00a8) ; §, ¨ (#x00ac . #x00ac) ; ¬ (#x00b0 . #x00b1) ; °, ± (#x00b4 . #x00b4) ; ´ (#x00b6 . #x00b6) ; ¶ (#x00d7 . #x00d7) ; × (#X00f7 . #x00f7) ; ÷ (#x0370 . #x03ff) ; Greek and Coptic (#x0400 . #x04FF) ; Cyrillic (#x2000 . #x206F) ; General Punctuation (#x2100 . #x214F) ; Letterlike Symbols (#x2190 . #x21FF) ; Arrows (#x2200 . #x22FF) ; Mathematical Operators (#x2300 . #x23FF) ; Miscellaneous Technical (#x2500 . #x257F) ; Box Drawing (#x25A0 . #x25FF) ; Geometric Shapes (#x2600 . #x26FF) ; Miscellaneous Symbols (#x2e80 . #xd7a3) (#xff00 . #xffef) ;(86327 . 86327) ;(#xff5e . #xff5e) ; 〜 )) ;; auto-insert LAST-MODIFIED-DATE (if (not (memq 'time-stamp write-file-hooks)) (setq write-file-hooks (cons 'time-stamp write-file-hooks))) (setq time-stamp-line-limit 40) (setq time-stamp-format "%3b %02d %:y") (setq system-time-locale "C") ;;; ;;; ファイルの設定 ;; tmp file saving directory (setq auto-save-list-file-prefix "~/local/.emacs.d/.saves-") ;; backup.file~ location (setq make-backup-files t) (setq backup-directory-alist (cons (cons "\\.*$" (expand-file-name "~/local/.emacs.d")) backup-directory-alist)) ;;; プログラミングの設定 ;; cc-mode (defun my-c-mode-common-hook () (c-set-style "java") ) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) (setq auto-mode-alist (append (list '("\\.c\\'" . c++-mode) '("\\.cpp\\'" . c++-mode) '("\\.h\\'" . c++-mode) '("\\.pl\\'" . perl-mode) '("\\.cgi\\'" . perl-mode) '("\\.rb\\'" . ruby-mode) )auto-mode-alist)) (modify-coding-system-alist 'file "\\.rb\\'" 'utf-8-unix) (modify-coding-system-alist 'file "\\.cgi\\'" 'utf-8-unix) ;; diff (setq diff-switches "-u") ;; handle '_' as a word (add-hook 'c++-mode-hook '(lambda () (modify-syntax-entry ?_ "w" c++-mode-syntax-table))) (add-hook 'perl-mode-hook '(lambda () (modify-syntax-entry ?_ "w" perl-mode-syntax-table))) ; ;; ruby-mode (setq load-path (cons (expand-file-name "~/local/site-lisp") load-path)) (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files" t) (setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) interpreter-mode-alist)) ;;; ;;; 操作の設定 ;;; ;; window-line ; move cursor just 1 line above/below (global-set-key "\C-p" 'previous-window-line) (global-set-key "\C-n" 'next-window-line) (global-set-key [up] 'previous-window-line) (global-set-key [down] 'next-window-line) (defun next-window-line (n) (interactive "p") (let ((cur-col (- (current-column) (save-excursion (vertical-motion 0) (current-column))))) (vertical-motion n) (move-to-column (+ (current-column) cur-col)))) (defun previous-window-line (n) (interactive "p") (next-window-line (- n))) (setq next-line-add-newlines nil) ;no next line in C-n ;; japanese word specific dabbrev ; Message-Id: <20000807.102524.60851386.gotoh@taiyo.co.jp> ; To: meadow-users-jp@meadow.scphys.kyoto-u.ac.jp ; Date: Mon, 07 Aug 2000 10:25:24 +0900 (JST) (defadvice dabbrev-expand (around jword (arg) activate) (interactive "*P") (let* ((regexp dabbrev-abbrev-char-regexp) (dabbrev-abbrev-char-regexp regexp) char ch) (if (bobp) () (setq char (char-before) ch (char-to-string char)) (cond ((string-match "[ァ-ヶー]" ch) (setq dabbrev-abbrev-char-regexp "[ァ-ヶー]")) ((string-match "[ぁ-んー]" ch) (setq dabbrev-abbrev-char-regexp "[ぁ-んー]")) ((string-match "[亜-瑤]" ch) (setq dabbrev-abbrev-char-regexp "[亜-瑤]")) ((string-match "[A-Za-z0-9]" ch) (setq dabbrev-abbrev-char-regexp "[A-Za-z0-9]")) ((eq (char-charset char) 'japanese-jisx0208) (setq dabbrev-abbrev-char-regexp (concat "[" (char-to-string (make-char 'japanese-jisx0208 48 33)) "-" (char-to-string (make-char 'japanese-jisx0208 126 126)) "]"))))) ad-do-it)) ;; 前回編集していた場所を記憶し,ファイルを開いた時にそこへカーソルを移動 (load "saveplace") (setq-default save-place t) ;;; 見た目の設定 (line-number-mode t) ;; マウスカーソルを消す設定 (setq w32-hide-mouse-on-key t) (setq w32-hide-mouse-timeout 5000) ;; erase memubar, scrollbar (menu-bar-mode -1) ;画面上に出るメニューを消す ;(scroll-bar-mode -1) ;画面横に出るスクロールバーを消す (setq cursor-in-non-selected-windows nil) ;非active windowにはカーソルを表示しない (transient-mark-mode -1) ;選択したとき色がつかないようにする ;; color (global-font-lock-mode t) ;font-lock use-all (setq font-lock-maximum-decoration '((c-mode . 1) (c++-mode . 1))) ;;level of fontification; least level ;; beep (setq visible-bell nil) ;; タブ, 全角スペースを表示する (defface my-face-u-1 '((t (:foreground "SteelBlue" :underline t))) nil) (defface my-face-b-1 '((t (:background "gray15"))) nil) (defface my-face-b-2 '((t (:background "gray26"))) nil) (defvar my-face-b-1 'my-face-b-1) (defvar my-face-b-2 'my-face-b-2) (defvar my-face-u-1 'my-face-u-1) (defadvice font-lock-mode (before my-font-lock-mode ()) (font-lock-add-keywords major-mode '(("\t" 0 my-face-b-2 append) (" " 0 my-face-b-1 append) ("[ \t]+$" 0 my-face-u-1 append) ;;("[\r]*\n" 0 my-face-r-1 append) ))) (ad-enable-advice 'font-lock-mode 'before 'my-font-lock-mode) (ad-activate 'font-lock-mode) ;; リージョンに色をつける (setq transient-mark-mode t) ;; kill-ring はテキスト属性(色情報など)を保存しなくていい http://www-tsujii.is.s.u-tokyo.ac.jp/~yoshinag/tips/elisp_tips.html#yankoff (defadvice kill-new (around my-kill-ring-disable-text-property activate) (let ((new (ad-get-arg 0))) (set-text-properties 0 (length new) nil new) ad-do-it)) (cond (window-system (blink-cursor-mode nil) ;; カーソルを点滅させない ;(setq scalable-fonts-allowed nil) ;; フォントのスケーラブルをしない (tool-bar-mode 0) ; tool-bar を消す )) ;; org-mode ;; MY PROJECTS -*- mode: org; -*- (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) (define-key global-map "\C-cl" 'org-store-link) (define-key global-map "\C-ca" 'org-agenda) (setq inhibit-startup-message t) ;;スプラッシュ(起動画面)抑止 (buffer-menu) ;;; Local Variables: ;;; coding: utf-8-unix ;;; End:
光ファイバで接続してると、快適に使用できるねー。ローカルアプリと変わらない。
いままでADSL 1.5Mで接続してたときは反応が遅くて、ネットワーク越しだとこんなものかと思っていたけど、プロパイダが違うことも影響してるのかな? まあ快適なのはよいことだ。
関連記事
- 作者: DanielJ.Barrett
- 出版社/メーカー: オライリー・ジャパン
- 発売日: 2006-11-22
- メディア: 大型本
おすすめ度の平均:
SSHの総合技術書