Fork me on GitHub

anyone feel like giving me a hand setting up cursive. i am able to run a project, but i just can't seem to set up using the repl and i feel like a clod because i can't do much else


mmm .. i wish i could screen share on this because when you see what i have you will know why i am kinda stranded in no mans land


i am using the latest intellij ce edition and the latest cursive plugin

Kari Marttila18:11:08

Ok. I'm running Cursive REPL all the time, it should be easy to configure, maybe you just miss some simple thing there...


gosh darn .. that is what is so frustrating .. i know it is possible .. i just can't figure it out

Kari Marttila18:11:30

Ok. I have latest IDEA Ultimate and latest Cursive, I'm running REPL all the time, so let's compare...


i don't even know what to say actually

Kari Marttila18:11:58

If you click Run Configurations...

Kari Marttila18:11:34

You have the Run/Debug Configurations dialog box...


they have this idea of run configurations, but i not sure what i am tying to configure .. i just randomly type stuff


trying to follow the docs ... so not really random ( but docs are old )

Kari Marttila18:11:08

Ok. You have clicked the "+" there...

Kari Marttila18:11:26

Then you choose "Clojure REPL"


first though there is this concept of templates


do you see that ?


there is Clojure application and then there are templates


i am in modal window for Run/Debug configuratoins

Kari Marttila18:11:31

Ok. Don't create a new template, use a template.


i go to templates, then closure Repl , then local

Kari Marttila18:11:58

So, click "+" then "Clojure REPL" -> "Local"


i am using run nREPL with Leiningen radio selected


i selected the module

Kari Marttila18:11:53

Ok. You now have the Run Configurations window open...

Kari Marttila18:11:17

There I usually choose: Which type of REPL to run: nREPL


i am on the step you said

Kari Marttila18:11:28

How to run it: Run with Leiningen


with Leingingen ( yes ) i am on that one

Kari Marttila18:11:52

Module: Choose your module.


what are those before launch tasks

Kari Marttila18:11:20

Don't worry about those. 🙂


i added Sychronize Leiningen projects and Build ?


but i was just random picking

Kari Marttila18:11:35

Now click "OK"


should i remove those things


the synchronize task and build task

Kari Marttila18:11:11

Before click "OK" give name to your Run configuration, e.g. "my-REPL"

Kari Marttila18:11:16

Then click "OK"


where would you put the name ?


profile ? textbox

Kari Marttila18:11:06

The "Name:" is on the up of the same window...

Kari Marttila18:11:32

(where you had "Which type of REPL to run"..., just above it)


i don't see it .. very odd


the name though it seems to extract from the module i selected ?? or something > i have no idea

Kari Marttila18:11:50

You have a "Run/Debug Configurations" modal window open?

Kari Marttila18:11:56

Ok, good. 🙂


i did it again .. first time i saw that

Kari Marttila18:11:07

Give name and click OK.


share or single instance ?


oo ..oo .. what now ?


we are getting somewhere . i can feel it

Kari Marttila18:11:17

Don't choose those options, just click "OK" now.


i ran that configuration

Kari Marttila18:11:11

Now in IDEA you should see the combo-box with your repl name (if you gave it e.g. name "my-REPL")


and it opened the REPL thing


below it i saw a text area so i typed in there


and it put the code in the REPL thing


wow .. this is it .. WORKING

Kari Marttila18:11:00

Ok. You should see the REPL window with two compartments, the upper part is the REPL output, the lower part is where you can interact with the REPL.

Kari Marttila18:11:11

In the lower part try: (+ 1 1)


is it working ? is this the shangrila i have been waiting for ?

Kari Marttila18:11:34

So, you see: => 2 in the upper part

Kari Marttila18:11:43

Good, you have a working REPL.


am i in business ?


finally .. gosh that was torture man ..

Kari Marttila18:11:18

Next you can try to interact with your system using REPL. Lisp REPL is by far the most productive development tool I have ever used, so learn to use it.


yikes, how the heck do i do that ?

Kari Marttila18:11:28

E.g. I have the following hot keys in my IDEA/Cursive to make working with REPL fluent: ;; Kari's Cursive settings that makes integration with editor and REPL more fluent: ;; <shift><ctrl><N> => Switch REPL namespace to current file (which is in editor when command given) ;; <shift><ctrl><M> => Load current namespace to REPL ;; <shift><ctrl><Å> => Send S-expression to REPL input ;; <caps><alt><U> => Focus to Editor (choose dialog window) ;; <esc><esc> => Focus to Editor last edit. ;; <caps><alt><I> => Focus to REPL output ;; <caps><alt><O> => Focus to REPL input ;; <caps><ctrl><I/K> => (In REPL): Browser REPL history ;; <ctrl><enter> => (In REPL): Send REPL input to REPL. ;; <caps><alt><J/L> => (In editor) => Switch tabs in editor ;; <ctrl><X>-<ctrl><O> (In editor) => Switch to next editor window (as in Emacs)

Kari Marttila18:11:15

You can configure those hot keys as you like in IDEA (see File -> Settings -> Keymap -> then search "REPL"...


the Switch REPL namespace to current file


dioes that mean

Kari Marttila18:11:52

E.g. Switch REPL NS to current file...


i don't have to type in that little window below the REPL and it will use current file instead


wow .. me want that !

Kari Marttila18:11:32

Then using that hotkey in the editor you can switch the REPL to use that namespace (file) and call directly the functions in that namespace in your REPL.

Kari Marttila18:11:59

So, your REPL is working now and you are good?

Kari Marttila18:11:26

Since my wife is calling me downstairs ... it's Saturday evening and our traditional movie evening is about to begin... 🙂


sure thing man .. i am all set .. THANKS A TON 🙂

Kari Marttila18:11:21

No problem. I was pretty sure it was just some minor detail that you missed. If you have any further questions about Cursive, ping here or in the beginners channel...


gotcha .. thanks again .. happy movie nights 🙂