RadRailsでTextMate風スニペットを使う
Railsで開発するのに便利エディターTextMate。ちょっとしたデモのムービーなんかではTextMateのスニペット機能を使ってサクサク開発するシーンをよく見ます。なんだけど、最近のユーロ高でTextMateの良心的なはずの価格39ユーロがとんでもない値段になってしまいます。(39ユーロ = 6 028.47531 円 2007/03/02現在)ウロウロしてたら、RadRailsを使って無料で「TextMate風スニペット」を実現する方法を発見。なかなか便利です。ありがとうDr.Nic。
Post-Halloween RadRails trick - all TextMate snippets availableインストール方法
1. 2つのXMLをダウンロードします。ruby-rr-templates.xml、rhtml-rr-templates.xml
どこでもいいけど決められない人はC:\Program Files\RadRailsにtemplatesフォルダでも作って入れてください。
2. RadRailsを起動
3. Windows > Preferences > Ruby > Editor > Templatesでテンプレートを確認
4. どれか1つのテンプレートをクリックした後、Ctrl+Aですべてのテンプレートを選択する
5. Removeボタンを押し、既存のすべてのテンプレートを削除
6. Import…ボタンを押し、ダイアログから先ほどDLしたruby-rr-templates.xmlを選択
7. 設定ウィンドウ左側のツリービューからRails > Editiors > RHTML Editor > RHTML Templatesへ移動
8. 先ほど同様、現状すべてのRHTML用のテンプレートを選択して、Removeボタンで削除
9. Import…ボタンを押し、ダイアログから先ほどDLしたrhtml-rr-templates.xmlを選択
10. OKボタンを押して完了
Installation
1. Download the two template XML files.
2. Open RadRails
3. Go to Windows > Preferences > Ruby > Editor > Templates, to see the list of included templates
4. Click on any template, and press Ctrl-A to select them all.
5. Click on Remove, to delete them all
6. Click Import…, select the file ruby-rr-templates.xml
7. Change to Rails > Editiors > RHTML Editor > RHTML Templates
8. Remove all the current templates
9. Click Import…, select the file rhtml-rr-templates.xml
10.Press Ok to close the dialog and you’re done