5
votes

I have loaded up Intellij and Cursive on my computer, all appears to work well except for the fact that I can not load a namespace in to the REPL nor can I run with Leinigen.

When I load the code into the REPL the REPL loads up but nothing is loaded into the REPL. I can then use the REPL though.

when I edit configurations I can only select normal processes and I can not run with Leiningen.

any help would be appreciated.

3
Do you expect any of your namespaces to be loaded in the repl at startup? This is not a standard behavior, and you need special config (like the :init-ns key in project.clj) to invoke it. The default is you get the user namespace, and then whatever other namespaces you manually require. - noisesmith

3 Answers

8
votes

Cursive, like most Clojure environments, doesn't load anything into your REPL by default. You can load code into the REPL using Tools→REPL→Load file in REPL. Note that this will not, by default, switch your REPL namespace to that of the loaded file - you'll need to use Tools→REPL→Switch REPL NS to current file for that, or you can require the loaded namespace into user as usual.

You should be able to create Leiningen Run Configurations, there is an option there to run specific tasks with Lein - if this doesn't work, please provide more information about exactly what you tried and what happened.

0
votes

An extension of the above answer that helped me:

  • File -> Settings -> Keybindings

  • In the search box, type REPL (to easily find the relevant bindings).

  • Find the bindings associated with the two needed menu options ("load file in REPL" and "switch REPL NS to current file").

  • Give them simple, similar bindings. I'm using ctrl+shift+L and ctrl+shift+M

I tried giving them the same keys, then ignoring the conflict warning in an attempt to have them both activate at once, but it seems to ignore the second one that was bound.

This is the best solution I've found so far.

0
votes

Alt + Shift + R is the keybinding.