TextMateの設定

新しいMacTextMateをインストールするときのメモ。

インストール

MacroMatesのサイトから「Download TextMate 2.0」をクリックする。

macromates.com

ダウンロードしたファイルをダブルクリックして展開し、「アプリケーション」フォルダに移動する。

起動

TextMateのアイコンをダブルクリックして起動する。

設定(Preferences)

⌘-, でPreferencesダイアログを表示する。

  • Bundlesから、「Ruby on Rails」と「RailsCasts」にチェックを入れる。
  • Software Updateから、「Crash Reports」のチェックを外す。
  • Terminalから、「Install」ボタンを押す。

Preferencesダイアログを閉じる。

設定(menu)

menuの「View」-「Font」-「Show Font」から、Familyは「Cica」、Sizeは「16」を設定する。

  • Cicaはあらかじめインストールしておく。
  • Sizeは直接入力して指定する。

menuの「View」-「Theme」-「Theme for Light Appearance」から「RailsCasts」を、「View」-「Theme」-「Theme for Dark Appearance」から「RailsCasts」を選択する(LightもDarkもRailsCasts)。

設定(Bundles)

ctrl + option + ⌘ + BでBundle Editorを選択する。

Ruby on Rails

  • 「params」の「Key Equivalent」を「ctrl + ⌘ + P」に変更する。
  • 「Jump to Method Definition」の「Key Equivalent」を「⌘ B」に変更する。

⌘ + Sで保存。

Ruby

  • 「Hashes」-「Hash Pointer」の「Key Equivalent」を「ctrl + L」に変更する。

⌘Sで保存。

Bundle Editorを閉じる。

設定(その他)

Tab

ウインドウ下部の「Tab Size」を変更する。

  • 「Indent Size」は「2」を選択する。
  • 「Indent Using」は「Space」を選択する。

Font Smoozing

ターミナルから以下を実行する。

defaults write com.macromates.TextMate.preview fontSmoothing 1

実行後、TextMateを再起動する。

Jump to Method Definition(⌘B) を動作するようにする

# 適当な場所にバックアップ
cp ~/Library/Application\ Support/TextMate/Managed/Bundles/Ruby\ on\ Rails.tmbundle/Support/bin/jump_to_method_definition.rb ~/Documents/jump_to_method_definition.rb.bak

# 新しいファイルで上書き
curl https://raw.githubusercontent.com/textmate/ruby-on-rails-tmbundle/191299f0c214e8491a5a0194177cb993188768b1/Support/bin/jump_to_method_definition.rb -o ~/Library/Application\ Support/TextMate/Managed/Bundles/Ruby\ on\ Rails.tmbundle/Support/bin/jump_to_method_definition.rb

TextMateを再起動する。

行末の空白を削除する

git clone https://github.com/bomberstudios/Strip-Whitespace-On-Save.tmbundle.git ~/Library/Application\ Support/TextMate/Bundles/Strip-Whitespace-On-Save.tmbundle

TextMateを再起動する。