Is there a way to talk to a Clojure REPL process from another process?

933 Views Asked by At

I'm wondering if I can make a Vim plugin that sends forms over to the REPL session that lein repl starts. Is there a way to send messages to an existing jline.ConsoleRunner process?

3

There are 3 best solutions below

2
cemerick On BEST ANSWER

Slightly OT, but this is what nrepl is for. IIUC, vimclojure uses nrepl now for the REPLs it starts, and allows you to connect to remote Clojure processes that have started an nrepl server. I don't think Leiningen has an nrepl plugin, though (yet).

1
Arthur Ulfeldt On

You may find the slimv vim plugin helpful.

see this SO question Sending input to a screen window from vim

A general approach is to start a screen session run lein repl, then sent the vim output to the screen session.

0
Blake Miller On

https://github.com/sattvik/lein-tarsier does more or less that ... I don't know if it's using nrepl or not, but with lein-tarsier you can have vimclojure talk via nailgun to a JVM which is also running a REPL. HTH