Overview

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

Steps

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)」をクリックします。

右側のコードはわかりやすいです。まずそのブラウザが起動しているかをチェックして、リフレッシュします。デフォルトではFirefox、ChromeやSafariなど全部対応しています。

Bundle Editor Refresh Running Browsers

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

もし特定のブラウザだけリフレッシュしたい場合は、コピペーで新規にSnippetを作成し、該当のブラウザのコードだけを貼ればいいです。以下はSafariの例です。

Textmate auto refresh safari

#ide #mac #textmate

現象

Railscastsで紹介したhttps://github.com/jezdez/textmate-missingdrawerProject 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

I encountered this problem when I synced my evernote in Mac OS.

Can’t synchronize error, Content is not valid.

I googled and found this in the evernote support forum.

One of the Ruby gems replaces the built-in ‘tidy’ command in OS X (/usr/bin/tidy) with a broken script in the same location. You need to restore the original /usr/bin/tidy command that comes with OS X.

On my 10.6.6 box, that command is 65072 bytes:

~ $ ls -al which tidy rwxr-xr-x 1 root wheel 65072 Aug 31 2010 /usr/bin/tidy

Once you’ve fixed that broken part of the OS, Evernote should work ok. You may also want to file a bug with the Ruby folks, who absolutely should not be replacing this file with their own.

It seems like that ruby gems in mac did a mess that replaced the /usr/bin/tidy command unintentionally. So if your tidy file size does not match 65072 bytes, just copy on from other Mac OS, and chmod it.

sudo gem install railsでこんなエラーが出ちゃいました。

Error installing rails bundler requires RubyGems version >= 1.3.6

解決策は

sudo gem update --system

pdating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.6.1
Updating RubyGems to 1.6.1
Installing RubyGems 1.6.1
RubyGems 1.6.1 installed

=== 1.6.1 / 2011-03-03

Bug Fixes:

#  Installation no longer fails when a dependency from a version that won't be
  installed is unsatisfied.
#  README.rdoc now shows how to file tickets and get help.  Pull Request #40 by
  Aaron Patterson.
#  Gem files are cached correctly again.  Patch #29051 by Mamoru Tasaka.
#  Tests now pass with non-022 umask.  Patch #29050 by Mamoru Tasaka.


------------------------------------------------------------------------------

RubyGems installed the following executables:
	/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

を実行した後にsudo gem install railsでrailsをインストールすればOKです。

#linux

If you ever need to restart your X session (your work will be lost if not previously saved.

Press this keys alt+ctrl+back_space

日本語

alt+ctrl+back_space です。。

事前に修正したファイルなどを保存してくださいね。

#textmate editor

TextMate Bundler:

http://github.com/handcrafted/handcrafted-haml-textmate-bundle

NetBeans plugin:

http://wiki.netbeans.org/FaqPluginInstall It’s really a simple plugin just for highlight the syntax. No auto-complete,and you cannot see the see the reference of ruby code in haml.

日本語

TextMateのBundlerはこちら:

http://github.com/handcrafted/handcrafted-haml-textmate-bundle

NetBeansのプラグインはこちらでダウンロード:

http://wiki.netbeans.org/FaqPluginInstall ほぼハイライト以外は何の機能もないです。 HAMLでRubyコードを書いても入力補完も、リファレンスも出ませんでした。