Fork me on GitHub
#spacemacs
<
2018-11-27
>
rowanharg11:11:37

Hi all, (hopefully) a quick question: do you have working keybindings for the cider inspector from spacemacs? For example, I am trying to get it to go back a page with no success using the M-SPC command or by calling M-x cider-inspector-prev-page.

practicalli-johnny12:11:31

Hello @rowanharg SPC SPC cider-inspect-last-result may be what you are looking for. I havent found a keybinding, so sounds like a pull request

aisamu13:11:39

SPC e v? comma e v

aisamu13:11:55

previous page is L

rowanharg13:11:04

Hi @jr0cket - sorry, my question was imprecise. I use cider-inspect-last-result to start the inspector but my question was about navigation once in the inspector. I can tab onto elements that cab be navigated, with RET but then not go back up.

rowanharg13:11:39

Thanks! @aisamu That was exactly what I was looking for!

😉 4
aisamu13:11:02

Just to clarify comma e v will eval and open the inspector. Also don't worry if the cider-inspect-last-result doesn't work during debugging, that seems to be the case 😕

rowanharg13:11:39

ah great, I was just going to ask about comma e v. Thanks!

rowanharg13:11:35

Hmm, comma e v is undefined.

practicalli-johnny13:11:35

@rowanharg I use , d v to open the value inspector, opening a read-only buffer with the value of the expression or symbol. Using RET to drill down on values in the cider-inspect buffer. Thanks @aisamu for the tip about L, most useful to know (I was trying to use hand H as I thought that would be a logical choice for a vim-style binding).

practicalli-johnny13:11:21

Its , d v in the develop branch, this may be different in master

rowanharg13:11:45

@jr0cket , d v works for me. Thanks!

aisamu13:11:56

@jr0cket oh my, you're absolutely right - the correct is , d v not , e v... muscle memory is apparently a thing 😛

👍 4
practicalli-johnny13:11:19

I would never have thought to use L for going back... so thanks again

aisamu13:11:48

You're very welcome - you've recently saved me with the new enable-refactoring flag...

bananadance 4
practicalli-johnny13:11:25

On the topic of debugging, I am quite impressed by the debugging you can do even without the sayid package enabled. I havent use debugging or the inspector that much in Clojure, but I am starting to get into it. Instrumenting a function with , d b and then calling that function and stepping through the values as it evaluates is really great way to see what is going on. I hope to get use to this soon and create some nice screencasts for debugging.

jumar08:11:54

It's very basic but I did one short video back then: https://www.youtube.com/watch?v=jHCch3-Yuac

practicalli-johnny14:11:33

Great video, thanks.

aisamu13:11:44

^ this is invaluable, and one of the things I miss the most on cljs

rowanharg13:11:55

Wow! That's cool!

aisamu13:11:52

You can also debug any top level statement with , d b (but with the cursor before, IIRC)

👍 4
rowanharg13:11:12

Inspired by Stu Halloway's recent talks on RDD, I was trying to explain to a friend about the tangibility of Clojure. Are there any other resources that you can recommend to learn about this? I also saw Val's What makes a good REPL guide.

rowanharg13:11:40

Oh I also saw a video of Bozhidar Batsov demonstrating Cider.

practicalli-johnny13:11:24

@rowanharg not tool specific, but the programming at the repl guide shows you lots of things you can do in a REPL to understand the code and values evaluated https://clojure.org/guides/repl/introduction

practicalli-johnny13:11:30

http://www.parens-of-the-dead.com/ also shows you what is possible. Its more live coding than a tutorial, but clearly demonstrates the art of REPL Driven Development

practicalli-johnny13:11:48

I am adding planning to add content on this topic to https://practicalli.github.io/spacemacs/, but there is still plenty to add and sections to complete

rowanharg13:11:06

@jr0cket Thanks for all these!

rowanharg13:11:24

I shall work my way through your guide

practicalli-johnny13:11:57

there is plenty of stuff to add to my guide, let me know what things you would find useful for me to add (on top more things about the inspector and debugging)

rowanharg14:11:11

@jr0cket - Just watched your intro screencast and learned about the green bars in the lefthand side of the buffer corresponding to whether the form hand been evaluated. Thanks!

rowanharg14:11:08

Have you ever managed to get two repls (one for clojure and one for clojurescript) from one project working at the same time? When I eval forms it always seems to want to send it to the repl that I just connected to.

practicalli-johnny14:11:27

I think they are improving CIDER to use the right repl based in regard clj and cljs. Not entirely sure where this is at.

practicalli-johnny14:11:20

I use the figwheel template and clojurescript-jack-in and it fires up two repls, first the clj and then the cljs repl. I almost always evaluate in the source code buffer and I think that gets it right. I think CIDER does need an occasional bit of manual help at the moment

rowanharg14:11:59

Ah ok. Thanks. I thought it was just me. 🙂