SublimeText入れています。
node.jsの実行をして簡単にシンタックス・チェックする。
javascript.sublime-build
{ "cmd": ["node", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": ["source.javascript"], "path": "/usr/local/bin" }
ポイントは cmd でコマンドを指定。コマンドの引数とコマンド名をcmd[0],cmd[1],cmd[2]...に指定する。
pathが通ってないコマンドを実行するときは path :"/User/takuya/bin/" などと指定する。
JSON.sublime-build
{ "cmd": ["/usr/local/bin/JSON.parse", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": ["source.json"], "path": "/usr/local/bin" }
同じように、JSONも可能。
ビルドファイルの定義の見つけ方
sublime textに定義済みの ビルド設定をリストしてみた。
takuya@air:~$ mdfind sublime-build /Users/takuya/Library/Application Support/Sublime Text 3/Packages/User/JavaScript.sublime-build /Users/takuya/Library/Application Support/Sublime Text 3/Packages/User/json.sublime-build /Users/takuya/Library/Application Support/Sublime Text 3/Local/Auto Save Session.sublime_session /Users/takuya/Library/Application Support/Sublime Text 3/Packages/User/ctags.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Ruby/Ruby.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/JavaScript/node.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/User/node.sublime-build /Users/takuya/Library/Application Support/Sublime Text 3/Packages/User/Package Control.cache/ad7758d143e99a76034aad71ae2a1f3b /Users/takuya/Library/Application Support/Sublime Text 2/Packages/User/Package Control.cache/ad7758d143e99a76034aad71ae2a1f3b /Users/takuya/Library/Application Support/Sublime Text 2/Packages/D/D.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Haskell/Haskell.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Java/JavaC.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Java/Ant.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Makefile/Make.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/C++/C++.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Erlang/Erlang.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/PHP/php.sublime-build /Users/takuya/Library/Application Support/Sublime Text 2/Packages/Python/Python.sublime-build/Users/takuya/Library/Application Support/Sublime Text 2/Packages/Default/new_templates.py
OSX なので mdfindを使った。通常であれば拡張子 *.sublime-buildで検索すればイイ。
なかなか使えるんだけど、カスタマイズがJSONで面倒だ。管理は楽だが、GUIでプチプチONオフ作れないので、何がどうなっているか、ちょっとわかりにくい。