Fork me on GitHub
#cursive
<
2018-11-24
>
daniel.spaniel17:11:31

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

daniel.spaniel17:11:58

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

daniel.spaniel18:11:02

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...

daniel.spaniel18:11:38

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...

daniel.spaniel18:11:57

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...

daniel.spaniel18:11:27

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

daniel.spaniel18:11:51

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"

daniel.spaniel18:11:30

first though there is this concept of templates

daniel.spaniel18:11:33

do you see that ?

daniel.spaniel18:11:46

there is Clojure application and then there are templates

daniel.spaniel18:11:05

i am in modal window for Run/Debug configuratoins

Kari Marttila18:11:31

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

daniel.spaniel18:11:39

i go to templates, then closure Repl , then local

Kari Marttila18:11:58

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

daniel.spaniel18:11:05

i am using run nREPL with Leiningen radio selected

daniel.spaniel18:11:32

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

daniel.spaniel18:11:25

i am on the step you said

Kari Marttila18:11:28

How to run it: Run with Leiningen

daniel.spaniel18:11:40

with Leingingen ( yes ) i am on that one

Kari Marttila18:11:52

Module: Choose your module.

daniel.spaniel18:11:11

what are those before launch tasks

Kari Marttila18:11:20

Don't worry about those. 🙂

daniel.spaniel18:11:26

i added Sychronize Leiningen projects and Build ?

daniel.spaniel18:11:34

but i was just random picking

Kari Marttila18:11:35

Now click "OK"

daniel.spaniel18:11:55

should i remove those things

daniel.spaniel18:11:10

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"

daniel.spaniel18:11:33

where would you put the name ?

daniel.spaniel18:11:56

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)

daniel.spaniel18:11:55

i don't see it .. very odd

daniel.spaniel18:11:45

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. 🙂

daniel.spaniel18:11:01

i did it again .. first time i saw that

Kari Marttila18:11:07

Give name and click OK.

daniel.spaniel18:11:19

share or single instance ?

daniel.spaniel18:11:50

oo ..oo .. what now ?

daniel.spaniel18:11:57

we are getting somewhere . i can feel it

Kari Marttila18:11:17

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

daniel.spaniel18:11:08

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")

daniel.spaniel18:11:17

and it opened the REPL thing

daniel.spaniel18:11:35

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

daniel.spaniel18:11:41

and it put the code in the REPL thing

daniel.spaniel18:11:47

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)

daniel.spaniel18:11:12

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.

daniel.spaniel18:11:46

am i in business ?

daniel.spaniel18:11:57

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.

daniel.spaniel18:11:35

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"...

daniel.spaniel18:11:40

the Switch REPL namespace to current file

daniel.spaniel18:11:43

dioes that mean

Kari Marttila18:11:52

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

daniel.spaniel18:11:01

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

daniel.spaniel18:11:06

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... 🙂

daniel.spaniel18:11:40

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...

daniel.spaniel18:11:41

gotcha .. thanks again .. happy movie nights 🙂