CotEditorのスクリプトで編集中のコードをrbeautifyで整形する方法。以下の通り、とても簡単。
- CotEditorのScriptMenuフォルダにrbeautify.rbをコピーする(rbeautifyはgemで入手可能)。
- rbeautify.rbの文頭を以下のようにする(書き換える)。
rbeautify_for_CotEditor.rb
#!/usr/bin/ruby -w
# coding: UTF-8
#%%%{CotEditorXInput=AllText}%%%
#%%%{CotEditorXOutput=ReplaceAllText}%%%
(以下略)
- ファイル名をrbeautify.^@R.rbなどに変更する。
以上。