简体   繁体   中英

How to run Clojure code on Sublime Text 2?

I wrote a script code of Clojure like this:

(print "test")

And when I pressed Shift+Ctrl+BI got this:

[Error 2]

[cmd: [u'lein', u'compile', u':all']]

[dir: D:\\Document\\ACM-ICPC\\Code\\PKU]

[path: C:\\Windows\\system32;C:\\Windows;...]

[Finished]

so,how to run it?

I use SublimeREPL when developing Clojure on SublimeText. It works, it supports other languages (CoffeScript, F#, Haskell ..), highly configurable and you will get a colored REPL!

I recommend to give it a try.

Seems like command lein compile :all is not what you need to run single script.

You can install lein exec plugin by adding line {:user {:plugins [[lein-exec "0.3.1"]]}} to your %USERPROFILE%\\.lein\\profiles.clj file.

And then add new Sublime build system or change existing with something like ['cmd': [u'lein', u'exec', '$file']]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM