Search code examples
intellij-ideasshclojurecursive

IntelliJ Cursive REPL over SSH


Usually, I work in vim, and I ssh to a server (doing web dev) to edit code, and run the dev server, etc. I'm trying to use Intellij IDEA with Cursive plugin for Clojure, and it would be great to replicate the same type of style. (So far, I'm really, really into the Intellij + Cursive combo!)

I've used sshfs mount, but IntelliJ understands that locally, so when I try to run a Ring server from the REPL, it runs locally instead of on the server, which is not what I'm looking for.

Basically, I'd like it to work via ssh transparently - edit the code on the remote server, run the REPL remotely, etc. If that is beyond what is possible today, that's an acceptable answer too.

I've searched high and low, thinking this would be (1) a reasonably common use case and (2) solved long ago, but maybe I just don't understand the IDE and clojure well enough yet (having started not too long ago).

Mountains of thanks if anyone has any words of advice for me.


Solution

  • Cursive dev here - I'm glad you're liking it!

    Cursive, mostly because of IntelliJ, is really set up for working locally. I'd be interested to know how working over sshfs works for you, IntelliJ likes to scan files a lot as it indexes, I've tried working remotely like that before and it was fairly slow, but that was with a massive Java project so YMMV. sshfs may have improved in recent years too.

    Re: the REPL, the best solution I can think of would be to start the REPL on the server manually, then you could connect to that using the Remote nREPL option over an SSH tunnel. It's a little clunky when setting it up and restarting the REPL, but it should work fine. Let me know if you'd like help setting that up.

    I'll think about ways that might be made more transparent, too. I suspect that it will be difficult because IntelliJ is really designed around local work.