October 12, 2011

TextMate Auto-refresh your browsers when saving file in Textmate


This is a tip to auto refresh your browser(s) when you hit Command + S(means saving file) in Textmate.


Open Bundle Editor, look for HTML, there will be a snippet called ‘Refresh Running Browser(s)’.

The code in the right side is very easy to understand. First it checks if one browser is opened, if yes, refresh it. By default it supports all the major browsers.

Bundle Editor Refresh Running Browsers

Set the Activation Key Equivalent to Command + S, and delete those file type in Scope Selector.
This way when you hit Command + S, text mate will save the file first and refresh all your opened browser.

If you want to just refresh a specific browser, like Safari, you can copy the snippet related to your browser.
Below is a sample for Safari.

Textmate auto refresh safari



Textmateでファイルを保存(Command + S)したら自動でブラウザをリフレッシュしてくれる。


Bundle Editorを開いて、HTMLのセクションの中の「Refresh Running Browser(s)」をクリックします。


Bundle Editor Refresh Running Browsers

Activation Key EquivalentをCommand + Sに変更して下のScope Selectorを空にします
これでCommand + Sでファイルを保存した場合起動中のブラウザは全部リフレッシュされるはずです。


Textmate auto refresh safari

Share on Twitter Share the post
Qihuan Piao

Qihuan Piao

(aka kinopyo) is Chinese based in Tokyo. Software writer. He shares stories inspired him in this blog. His infamous line - "I feel calm when I kill those monsters, or people (in game)" shocks his friends deeply.

He also writes in Japanese and Chinese.