Is there a colored REPL for Clojure?

2019-01-31 02:45发布

I'd like to get a colored REPL for clojure code, similar to what you can do with IRB for Ruby.

Are there any libraries or settings for user.clj that provide automatic coloring of the REPL?

Example IRB:

alt text

11条回答
可以哭但决不认输i
2楼-- · 2019-01-31 03:17

Some coloring have REPL in VimClojure.

查看更多
Ridiculous、
3楼-- · 2019-01-31 03:20
  • Install Emacs 24
  • Install Emacs Starter Kit v2
  • M-x package-install -> starter-kit-lisp
  • Add to init.el: (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup)
  • Install Swank for Clojure
  • Open your Clojure project and M-x clojure-jack-in

Emacs REPL

查看更多
Ridiculous、
4楼-- · 2019-01-31 03:21

Try out Light Table Playground by Chris Granger. It is the first part of more ambitous multi language IDE.

It has a color Clojure REPL that does real time evaluations and display for entire blocks of code.

http://www.chris-granger.com/lighttable/

You can see a higher level view of the project here:

http://www.kickstarter.com/projects/ibdknox/light-table

查看更多
该账号已被封号
5楼-- · 2019-01-31 03:21

If you're an Intellij user, the excellent Cursive is a great choice, and provides pretty colours that you can customise:

enter image description here

查看更多
唯我独甜
6楼-- · 2019-01-31 03:25

If you just want to color the prompt and you are using Leiningen (which you should), you can use :repl-options and ANSI escape sequences:

:repl-options {:prompt (fn [ns]
                         (str "\033[1;32m"
                              ns "=>"
                              "\033[0m "))}

References:

查看更多
The star\"
7楼-- · 2019-01-31 03:27

You can try LightTable, it lets you select the functions and run instantly.

查看更多
登录 后发表回答