forked from clojure/clojurescript
-
Notifications
You must be signed in to change notification settings - Fork 1
Sublime Text 2
hcliff edited this page Jun 10, 2012
·
2 revisions
Install Sublime Text 2, install Sublime Text Package Control, use that to install the SublimeREPL package, and finally, install Leiningen 1.7.
From the Sublime Text 2 menu, Preferences > Browse Packages. You'll be taken to the Packages folder, open SublimeREPL/config/Clojure/Main.sublime-menu. Add a new command that looks like this:
{"command": "repl_open",
"caption": "ClojureScript",
"id": "repl_clojurescript",
"args": {
"type": "subprocess",
"encoding": "utf8",
"cmd": {"windows": ["lein.bat", "repl"],
"linux": ["lein", "repl"],
"osx": ["lein", "trampoline", "cljsbuild", "repl-listen"]},
"soft_quit": "\n(. System exit 0)\n",
"cwd": {"windows":"c:/Clojure", // where the lein.bat lives!
"linux": "$file_path",
"osx": "$file_path"},
"syntax": "Packages/Clojure/Clojure.tmLanguage",
"external_id": "clojure",
"extend_env": {"INSIDE_EMACS": "1"}
}
}
You may also need to enable keyboard shortcuts for SublimeRepl. Again open packages SublimeREPL and open the keymap that pertains to your OS (e.g: Default (Linux).sublime-keymap)
Now uncomment the lines at the bottom. You can use these commands to send code straight to the REPL and trigger browser evaluation. (Roughly equivalent to emacs C-c C-e)