Syntax highlighting in Lein REPL?
Asked Answered
T

4

6

I want to configure Lein so that I see a colored REPL, like Emacs' nREPL. How can I do this?

I couldn't find any help on Google. Do I need to learn Bash scripting first?

Trephine answered 21/10, 2013 at 16:52 Comment(1)
Similar question: Is there a colored REPL for Clojure?Gotham
G
16

Ultra, “a Leiningen plugin for a superior development environment”, highlights syntax well for REPL output, among other useful things.

screenshot of Ultra
At the moment, there are no plugins or stand-alone REPLs that highlight syntax for input.

Gotham answered 11/2, 2015 at 21:14 Comment(0)
M
3

Whidbey “pretty-prints colored REPL values by default”, using Puget to do the actual pretty-printing. Whidbey’s README seems to indicate that you can install it for all Leiningen projects simply by adding the following :plugins value to your user profile at ~/.lein/profiles.clj:

{:user {:plugins [[mvxcvi/whidbey "0.5.0"]]}}

Though I personally couldn’t get it to work, no matter what I tried.

You can also look at the Colors page on REPLy’s wiki. (REPLy is the REPL built-in to Leiningen 2, and it integrates with nREPL.) For now, all that wiki page contains is a link to Whidbey, but it might be updated in the future.

Maemaeander answered 1/10, 2014 at 8:30 Comment(3)
Using the above works for me, but the highlighting is very limited and only applies to the output.Gotham
Sorry, didn't mean to seem rude with the editing and the bold font.Gotham
@Josh Don’t worry, your edit wasn’t rude. I can see that the context makes the code block easier to understand.Strategy
B
1

You don't have to use Bash for this at all – the shell only starts processes on the command-line, but they can be written in any language.

I don't think nREPL or its terminal client which is integrated into Leiningen as lein repl, REPL-y, provide any support for syntax colouring themselves. So the most promising approach is probably to fork REPL-y and integrate syntax colouring into it yourself, probably based on some existing syntax colouring solution for Clojure.

Bolin answered 21/10, 2013 at 18:10 Comment(0)
S
0

From emacs client you can try emacs-live

https://github.com/overtone/emacs-live#colour

Colour

Colour highlighting in two flavours - cyberpunk and gandalf. Use color-theme-cyberpunk and color-theme-gandalf to switch between the two themes. Currently cyberpunk has seen more love - patch requests accepted for appropriate improvements to Gandalf.

Supernational answered 24/10, 2013 at 11:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.