Fork me on GitHub

All three pull requests I asked for feedback from have all been accepted and merged into develop branch. Thanks to everyone for your feedback.

🎉 4

If there any other aspects of the Clojure layer you think could be improved, feel free to discuss.


Perhaps bindings for the -up-to-point evaluation variants?


I believe one has just recently been added , e v, I was not aware of these, I will investigate. Any you particularly use?


There are only two, sexp and defun. They're useful to evaluate "incomplete" expressions, such as the first half of threading macro without having to comment all the remaining lines. I usually pick sexp (`C-c C-v C-o` is the default binding)


happy to add these bindings. what do you suggest? SPC m e p p for sexp (as its defalt) and SPC m e p f for defun?


I would like to understand what parts of the Clojure layer are most used, or possibly more importantly what do you not use or think should be changed.


I am especially curious about the keybindings under SPC m s - the repl part of the menu for the Clojure layer. There are quite a few 'send-to-repl' functions under that menu, do people actually use these?


I miss a lot ability to send to level form inside comment exp


I typically comment individual lines with #_ comment reader macro.


With the (comment ,,, ) function, you can use the inline evaluation functions , e e - I use this on the next line after the expression I want to evaluate , e v on the opening paren of an expression


Would you be willing to elaborate on your workflow?


Is it something like this: 1) jack-in 2) , s s to open the repl buffer 3) write / navigate to code in source code buffer 4) , s f or , s e to evaluate code in the REPL buffer?


@U05254DQM I think what @U1V7K1YTZ is meaning to say is if I'm inside an sexp like (+ 1<here> 2) and want to evaluate the form to 3 I shouldn't have to go to the opening brace which , e v needs. Correct me if I'm wrong @U1V7K1YTZ as this is something I sorely need too 😞

👍 4

On a side note, do you have an idea how to do this @U05254DQM? 🙂


Yes, this is correct. Thanks for explaining


cider-pprint-eval-defun-at-point kinda works for this case, but if im in a nested sexp like (def a (range 0<here> 5)) and I wanna see (0 1 2 3 4) as output, it evals the whole def form


, e v is in develop now for cider-pprint-eval-defun-at-point but as you say its not quite what you are wanting all the time. Its not something I do, perhaps #cider channel has some suggestions


;; It's often convenient to send to repl instead of switching to it
;; so you can have all your research stuff in one place - the data, the flow
(def data {:some :data})
(call-some-fn-on data)
;; etc


@jahson So you prefer to send evaluation to the separate REPL buffer, rather than seeing the evaluation results inline in the source code buffer


I think I got a part of this habit from vim's fireplace.


Very interesting, thanks for sharing. I think my preference for showing the evaluation results inline comes from LightTable


I think I must elaborate on this. I've been used to opening the repl and writing code inside of the repl at the start. After that I've started to learn fireplacethings, like cqp to open a prompt and eval, or cpp to eval the innermost form. Eventually I've started working without repl being visible, only reaching it for cases when I've needed to work on some big structure that doesn't fit into vim's message area. Around that time I've got te gist of (comment), that it helps with not relying on repl history, that the data is more visible, and that the repetition is easier. Nowadays I often work without open repl, but I've seen many other people relying on repl being open.


> Nowadays I often work without open repl, but I've seen many other people relying on repl being open. That means that I've prefer inline evaluation atm 🙂


Good to know, thanks. Do you ever use the #_ comment reader macro instead of (comment ). For example:

(handy-funciton-helper arg)


Or comment out parts of an expression that is essentially a pipleline, like a threading macro

(->> book
     (re-seq #"[a-zA-Z0-9|']+" ,,,)
     (map #(clojure.string/lower-case %))
     #_(remove common-english-words)
     #_(sort-by val)


For me the comment reader macro is like a comment. I think it should't get into vcs, like the other commented out code. OTOH the (comment) for me is like a playground that can be reused later. And it might get to vcs.


I use the #_ exactly as a playground and place that playground code at the bottom of the file, usually with a description of each expression and why its there.


I should probably try this.


I don't use this reader macro often, but I've seen people using it. I learned about this macro after about two years into clojure, so I'm not very used to it.


To comment thing out I use comments 😉


Like gcaf inside the form I need to comment.


I believe you can just use gcc if I understand you correctly


No, the gcc comments the line iirc.


The gcaf is a "phrase" = g c(omment) a(round) f(orm)


I don't recall what is the g for.


Ah, yes, I wasnt using gacf on a nested function 🙂 I see what you mean now. Thats nice, I didnt know that (no vim background for me)


And it will conveniently move the parentheses to the next line.


very nice 🙂 I will add that to my book...


Just tried in vim: it's not so convenient and comments out everything, including the parentheses that shouldn't be commented.


Just refreshed my memory: gc is the command, and the af is the motion.


Thanks. If you have any other vim-like things you find valuable in Spacemacs I would really like to hear about them. What I have learnt so far is on and the following few pages.


Sure. If I remember anything useful, I'll post it here. By the way thank you for your book, it helped me a couple of times.

👍 4

I also often use the daf, dsf, caf, cif. The af and if text objects seems to be from


I think there should be some kind of keypress tracker.


Ah, it's called keyfreq.


Perhaps bindings for the -up-to-point evaluation variants?