Archive for the ‘IDE’ Category
2011年10月12日
Textmateでファイルを保存(Command + S)したら自動でブラウザをリフレッシュしてくれる。
Bundle Editorを開いて、HTMLのセクションの中の「Refresh Running Browser(s)」をクリックします。
右側のコードはわかりやすいです。まずそのブラウザが起動しているかをチェックして、リフレッシュします。デフォルトではFirefox、ChromeやSafariなど全部対応しています。

Activation Key EquivalentをCommand + Sに変更して下のScope Selectorを空にします
これでCommand + Sでファイルを保存した場合起動中のブラウザは全部リフレッシュされるはずです。
もし特定のブラウザだけリフレッシュしたい場合は、コピペーで新規にSnippetを作成し、該当のブラウザのコードだけを貼ればいいです。以下はSafariの例です。

Tags: Chrome, editor, safari, textmate, Tips
Posted in TextMate | 1 Comment »
2011年08月20日
最後の編集した箇所に遷移する機能はTextMateデフォルトではないですが、多分みんなUndo/Redoで実現していたと思います。
でも⌘Z(Undo)、⇧⌘Z(Redo)はやはり手間がかかってしまいますので、一発でできるかをググッてみたところ、TMGoToLastEditを見つかりました。
ダウンロード、解凍、ダブルクリックでインストール完了です。
⌥⌘J ( Option + Command + J )
あるいは
Navigationのメニューからクリック

Tags: textmate, Tips
Posted in TextMate | No Comments »
2011年08月19日
⌘TはTextMateで速やかにファイルを開ける機能ですが、例えばこんなファイルがあるとします。
- blogs/index.html.erb
- posts/index.html.erb
- categories/index.html.erb
- tags/index.html.erb
- users/index.html.erb
で⌘Tで”blogs/index”を叩くと何も表示されない、つまりパスが効かないのが一番の問題です。それを解消するのがgotofile.tmbundle
cd ~/Library/Application\ Support/TextMate/Bundles/
git clone git://github.com/stevenchanin/gotofile.tmbundle.git GoToFile.tmbundle
で、textmateを再起動
⇧⌘K ( Command + Shift + K )で新しいGo To Fileダイアログを開いて”ar/in”を叩くことでarticles/index.htmlが選択されます!

他にもspaceキーでQuickLookモードでファイルを見たり、⌥(option)キーでデフォルトのアプリでファイルを開いたり、⇧(shift)キーでフォーカスに選択したファイルのパスを入力することができます。
http://how-i-work.com/workbenches/2-keyboard-based-no-mouse-rails-development-with-textmate
Tags: Mac, textmate, Tips
Posted in TextMate | No Comments »
2011年08月16日
git clone https://github.com/enormego/EGOTextMateFullScreen.git /tmp/EGOTextMateFullScreen
xcodebuild -project /tmp/EGOTextMateFullScreen/EGOTextMateFullScreen.xcodeproj -target EGOTextMateFullScreen
cp -R /tmp/EGOTextMateFullScreen/build/Release/EGOTextMateFullScreen.tmplugin ~/Library/Application\ Support/TextMate/PlugIns
# after installed
rm -rf /tmp/EGOTextMateFullScreen/
これが完成図!

Tags: Mac, textmate, 環境構築
Posted in Mac, TextMate | No Comments »
2011年06月04日
Railscastsで紹介したjezdez/textmate-missingdrawer – GitHubProject Drawerのプラグインをインストールした後に、ターミナルやTextMateのGUIでフォルダを開くときに画面が真っ白になる。ファイル一つ一つは開ける。
ターミナルで開いた時はこんなエラーを吐き出される:
mate[19082:903] Exception raised during posting of notification. Ignored. exception: '[NOTE: this exception originated in the server.]
-[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)' invoked observer method: '-[OakLaunchHelper didLaunchTextMate:]' observer: 0x1128a0 notification name: 'NSWorkspaceDidLaunchApplicationNotification'
昔ProjectPlusというProject Drawerをインストールしたことがあり、どうやらその二つが衝突しているよう。
~/Library/Application Support/TextMate/Plugins/ProjectPlus.tmpluginを削除
参考:http://ticket.macromates.com/show?ticket_id=188F672C
Tags: Mac, textmate
Posted in IDE, Mac | No Comments »
2010年10月16日
ビープ音を消す。
vi ~/.inputrc
set bell-style none
vi ~/.vimrc
set noerrorbells
set vb t_vb=
Tags: editor, vim
Posted in IDE | No Comments »
2010年08月08日
Userモデルにどのカラムを定義したっけ、と言う場合schema.rbをいちいちチェックしないで済む方法があります。それがCarlos Brando氏が作ってくれたRuby on RailsのTextMate Bundleです。
これは元々のDr. Nic氏のruby-on-rails-tmbundleをForkして作ったものなので、従来の機能は保ちつつ新しい便利な機能が追加されました。
例えばUserモデルの変数user, @user, @@userなどの後ろでAlt(Option) + Spaceを押すと利用可能な属性がリストされます。なかなか便利です。
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/carlosbrando/ruby-on-rails-tmbundle.git "Ruby on Rails.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'
本家サイト:http://github.com/carlosbrando/ruby-on-rails-tmbundle
Tags: rails, textmate
Posted in IDE, Ruby | No Comments »