This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-06
Channels
- # announcements (5)
- # aws (28)
- # babashka (4)
- # beginners (163)
- # bristol-clojurians (2)
- # calva (4)
- # cider (18)
- # clj-kondo (30)
- # cljs-dev (28)
- # cljsrn (50)
- # clojure (96)
- # clojure-europe (25)
- # clojure-italy (6)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-sweden (7)
- # clojure-uk (32)
- # clojurescript (39)
- # conjure (74)
- # cursive (12)
- # events (1)
- # fulcro (32)
- # helix (71)
- # jackdaw (2)
- # leiningen (10)
- # off-topic (14)
- # pathom (59)
- # rdf (7)
- # re-frame (6)
- # reitit (28)
- # ring (7)
- # shadow-cljs (207)
- # slack-help (2)
- # spacemacs (3)
- # specter (7)
- # sql (12)
- # tools-deps (14)
- # xtdb (32)
I remember something that values in the log buffer should be pretty printed. They don’t seem to be for me. Is that something that has to be enabled manually? Relatedly, is there a way to grep conjure’s docs from within vim?
So in the docs you can just hit / and search for what you need, it's just a buffer. As for the pretty print it should be working already! It's all set up to :thinking_face:
Yeah searching a buffer with /
makes sense, I guess I was more asking for a way to search all the help texts since there are multiple. Like in this case I’d have loved to just grep the entire conjure help for “pretty”
I have some 960 characters long output that isn’t pretty printed. Should that kick in at that length?
Ah I see! Yeah, I suppose a grep would be good but that's be a vim thing if it existed. I could add more tags then you could tab complete things too
When you enable debug mode (`ConjureConfig clojure.nrepl/debug? true`), does the eval nREPL message have pprint specified I wonder?
Also this may be a CLJS thing... maybe CLJS + nREPL doesn't allow pprint :thinking_face:
Yep, looks like pprint isn't working with shadow-cljs connections, but it works with JVM. I'm providing the option still, it's just being ignored. Let me check plain piggieback too, it might just be shadow-cljs (and babashka etc)
So I gave it a test, only regular JVM Clojure supports the pretty print argument on eval. Shadow, babashka and a regular piggieback+node all ignore it.
Also, :helpgrep
is a thing! I had no idea, so you can use :helpg eval-replace
to jump you to the docs on eval-replace!
Thanks for looking into it! do you know if this is an issue with Shadow or some CLJS nREPL tooling?
Ohhh you're getting CLI highlighting in your doc output. I presume you have something like rebel readline installed (or similar)?
If I can solve this you'll get highlighting there https://github.com/Olical/conjure/issues/53
You could give this a go too https://github.com/chrisbra/Colorizer
I'd imagine you have a lib or some middleware that's colouring the output though. Or trying to.
Yep, that'll do it! I would love to support those terminal escape codes and add colour, it's just sort of a long term goal and something I think can be served by another plugin that others have written.
I'd rather not implement it all myself, I'd rather find another project that works well and recommend that for those that REALLY want those terminal colours displayed. Personally, I never see them in any of my output, I think some test runners insert them though.
i still think https://github.com/norcalli/nvim-terminal.lua has promise, they just need to sort out the luajit issues
it would also be great if colorizer could sort out their consistency issues. the maintainer doesn't seem very responsive
Also, :helpgrep
is a thing! I had no idea, so you can use :helpg eval-replace
to jump you to the docs on eval-replace!
I'm going to store the previous result of each eval so you can paste it wherever you want, a bit more flexible version of eval and replace.
Poll: Should the mechanism of storage and retrieval be...
🍎 Based on built in registers, you configure which one (maybe c
by default), so you can just use "cp
to paste, or access them in Vim Script etc.
🍌 Stored in a variable inside Conjure's Lua, separate to registers, and pasted with a specific mapping such as ep
or pe
. (the latter allowing for maybe pd
for debug info or something in the future. Basically just a "paste something" mapping.
🍊 A hybrid. Put into the black hole register by default and you use pe
(or whatever) to paste, but you can set the storage register to "
(default) or C
etc then use regular register mappings if you want to.
I kinda like the built in registers approach since you could set it to the default register, then get paste history, and just hit p
or P
to paste after an eval.
This would wipe out whatever you just yanked, but so does editing. And this could be an option for those that liked it, you could always set it to the black hole _
if you didn't want it or c
etc.
Maybe both? Like default to _
, let people do what they want with it, but also have a special paste mapping which isn't as flexible but doesn't interfere with registers.
And just saying "put previous results in this register" will work a lot better in practice
I may throw out the implementation on develop in favour of a config that lets you put your results in a normal register. Not only is it much easier to implement, it's easier to get right.
Develop allows you to paste previous results before or after the cursor as well as over a visual selection https://asciinema.org/a/327290 I hope it works well!
If you like this kind of Conjure specific paste register I may add things like "the code you last evaluated". Plus anything else useful I can think of.
then i imagine you could do (assuming \
is your prefix) \p1
to print *1, \p2
to print *2, \pe
to print the last error
That's basically where I'm going with it, yeah. That'd be a Clojure specific extension to the general idea of "Conjure can paste things"
<prefix>pr
is useable in any support Conjure language right now. The *1 *2 *3 would be Clojure... or I implement 1 2 3 in a generic sense as well
Although last error would be very tricky since the client then needs to signal when a result is an error. Some clients won't know.
I'll let this feature sit for a bit, see what people think then decide if I should invest more into it and how 🙂
I may well throw this out in favour of just putting it in a normal vim register for you to use (and configure). So don't get too attached to the p
and P
prefixes 😄
i imagine you could just put values like *1, *2, *3, *e into lua variables or whatever and then users could write their own mappings if desired
Yep! It's just raw data right now, so it's pretty ugly, but it does contain all the info you need.
I'm holding off prettifying it until I have an idea of how to make interactive things you can collapse and explore. Like being able to hide massive results and explore them in an async interactive way, maybe using a 3rd party tree explore plugin. (I think vim-iced does this and it looks awesome)
I'd love to say "this is too big, here's the top level, hit enter on things to request the rest" or something like that. A long way out though, lots more QoL low hanging fruit first!