cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
respatialized 2020-11-15T18:23:24.008700Z

is there a way to auto-eval an expression in the REPL on namespace load? basically what I'm trying to do is auto-refer clojure.repl/doc into every namespace, because I pretty much always find myself typing (require clojure.repl [:refer doc]) in every repl session so it's available in the namespace I'm working in. just wondering if there's a general purpose solution to this that could be used to auto-load other code, as well.

bozhidar 2020-11-16T09:46:55.015500Z

There's a REPL shortcut to require the REPL utils in some namespace. Type , in the REPL and you'll see what I mean.

1
practicalli-john 2020-11-15T20:41:59.014900Z

@afoltzm I'd suggest just using cider-docs and evaluate code in the source code buffer rather than evaluate in the REPL buffer directly, which requires more work (changing namespaces, etc). There is also cider-clojuredocs which also provides examples of using the function and cider-apropos that will help you find functions. https://practicalli.github.io/spacemacs/documentation/cider-doc.html If you really have to use the REPL buffer directly and need doc, , will open a REPL menu which has a doc function. If you really want to type (doc function-name), then you can use the the fully qualified name, (clojure.repl/doc function-name) You could require refer doc in every single namespace function of every project you ever work with, which I am sure will raise a few questions about why. I would definatey not recommend this 🙂