RailsCastsのThemeを手に入れる!
ちなみにRailsCastsとは、RailsのTipsをPodcasting!
Rails + 英語の勉強が出来てしまう2度美味しいオープンソース!
Package Controleのインストール
インストールするにはメニューからView > Show Console
でコンソールを立ち上げて下記のコマンドを実行。
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
Package ControleはCommand Palleteから実行されており、Command Pallet はcmd + shift + p
(OS X)で開けます。
Command Palletはパッケージのインストール、リポジトリの追加、パッケージの削除などいろいろ便利。
他にもいろいろなコマンドもあります。
各種設定
コマンドラインのセットアップ
コマンドラインからSublime Text2を起動するためにsublへのシンボリックリンクを作成する。
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
※シンボリックリンクとは:あるファイルやディレクトリに別の名前を与え、ユーザやアプリケーションがその名前をファイル本体と同様に扱えるようにする仕組み。lnコマンドで実行。
これでsublをコマンドラインで動かせるようになります。
きちんと実行されていればsubl --help
でヘルプが参照できます。
テーマの適用
RailsCastsのテーマを適用
下記からテーマをダウンロード
設定
ダウンロードしたテーマファイルをSublime Text2のパッケージディレクトリへ配置
% cp ~/Downloads/Railscasts.tmTheme ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/
これでSublime Text2を起動してSublime Text2 > Preference > Color Scheme > Railscasts
を選択すると、Railscastsのテーマが適用されます!