conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
dave 2020-06-15T14:27:13.223700Z

https://clojurians.slack.com/archives/CK143P6D7/p1592061883212600 i gave this a try this morning on a whim, and i like it! it's something i didn't know that i would want, but now that it's here, i totally want it

dave 2020-06-15T14:27:52.224600Z

i didn't realize it, but without this feature, i had developed a habit of avoiding moving my cursor immediately after evaluating something. now i can eval something and then feel free to keep moving, which feels liberating

dave 2020-06-15T14:28:03.225Z

it's funny how little things like that can make all the difference

Olical 2020-06-15T14:31:09.225600Z

Ooo that’s great to hear! Thanks for the feedback! Still not sure about turning it on by default (99% sure no) but glad you like it!

Olical 2020-06-15T14:31:26.226100Z

Let me know if you see any weird race condition things where it closes when it shouldn’t or something

dave 2020-06-15T14:31:33.226300Z

will do

dave 2020-06-15T14:32:17.226900Z

i'm trying to test using AnsiEsc in the conjure HUD now, but having trouble getting it to do the thing

dave 2020-06-15T14:33:09.227600Z

i see that i need to run :AnsiEsc manually to get it to interpret the ANSI escape codes, but i think i would need to have the HUD focused in order to do that, right? and i can't seem to focus the HUD

dave 2020-06-15T14:34:06.228700Z

my setup is that i'm using the clojure.term.colors package, (require '[clojure.term.colors :as term]) and then i'm running (println (term/red "hey")) which should print they word "hey" in red

dave 2020-06-15T14:34:54.229Z

dave 2020-06-15T14:35:08.229600Z

running :AnsiEsc (with my clojure buffer focused, not the HUD) has no effect

Olical 2020-06-15T14:35:17.230Z

Oh you need to open the log buffer

Olical 2020-06-15T14:35:21.230300Z

then the hud will have it too

dave 2020-06-15T14:35:25.230500Z

ah, yes - it totally works in the log buffer

Olical 2020-06-15T14:35:34.231Z

It applies to the buffer, not the window, and the HUD is just a small window onto the buffer

dave 2020-06-15T14:35:45.231300Z

aha! then it does work in the HUD too

Olical 2020-06-15T14:35:49.231500Z

Yep! 😄

dave 2020-06-15T14:48:51.231900Z

dave 2020-06-15T14:48:57.232500Z

i'm quite happy with this!

dave 2020-06-15T14:49:20.233300Z

it seems like there are some minor kinks to work out with some of the bold escape sequences though

Olical 2020-06-15T14:49:35.233700Z

I know some of the colouring bleeds into other things, haven’t worked that out yet… it’s to do with vim syntax contains and containedin logic I think :thinking_face:

dave 2020-06-15T14:50:03.234Z

so far it at least seems more stable than colorizer 😅

dave 2020-06-15T14:50:12.234300Z

i think i'm probably going to drop colorizer and use this instead

Olical 2020-06-15T14:50:29.234700Z

It was like a two hour hack on top of an existing plugin, so could definitely be improved furhter!

Olical 2020-06-15T14:50:43.235100Z

And with some event hooks in Conjure you could auto run it, but not just yet

dharrigan 2020-06-15T14:51:09.235700Z

quickie, setting a conjure config variable, it writes into a config file?

dharrigan 2020-06-15T14:53:04.236200Z

also, will nRepl 0.8 with completions and lookup have any effect on conjure?

Olical 2020-06-15T14:59:25.236300Z

As soon as it’s released I’m planning on adding backwards compatible support for these things. I think I will have to make some small changes, I don’t think they use the same op names and arguments? If they do it’ll work out of the box.

Olical 2020-06-15T14:59:56.236500Z

Hmmmm interesting. Although I can’t think of any other vimmy things that work like this :thinking_face: going to replace the config system with a simple vim table soon anyway.

Olical 2020-06-15T15:00:04.236700Z

I’ll give this some thought.

dharrigan 2020-06-15T15:03:12.236900Z

Sorry, that was badly worded

dharrigan 2020-06-15T15:03:14.237100Z

It should have been

dharrigan 2020-06-15T15:03:35.237300Z

When setting a conjure config variable, does it write into a config file (which you’ve implicitly confirmed as no)

dharrigan 2020-06-15T15:03:43.237500Z

So, for example, ConjureConfig log.strip-ansi-escape-sequences-line-limit 0

dharrigan 2020-06-15T15:03:56.237700Z

where is that variable set (permenantly)?

Olical 2020-06-15T15:04:30.237900Z

That’s just in memory, like doing let g:…

Olical 2020-06-15T15:04:38.238100Z

So no, it doesn’t write anywhere I’m afraid

Olical 2020-06-15T15:04:51.238300Z

I’m going to change it all to just be let g:conjure_config.foo.bar = … some time soon

Olical 2020-06-15T15:05:01.238500Z

And deprecate the command, I want to make it less special if I can.

dharrigan 2020-06-15T15:05:06.238700Z

kk

Olical 2020-06-15T15:36:08.238900Z

Would I be able to get this code as text? Will be useful in stress testing my hacky AnsiEsc fork!

dave 2020-06-15T15:46:57.239100Z

sure!

dave 2020-06-15T15:48:15.239300Z

(doseq [color (keys term/*colors*)
          :let [color-fn (ns-resolve
                           'clojure.term.colors
                           (symbol (name color)))]]
    (println (color-fn color))
    (println (term/bold (color-fn (str "bold " color)))))

dave 2020-06-15T15:48:41.239500Z

and in the ns form, i have (:require [clojure.term.colors :as term])

dave 2020-06-15T15:49:05.239700Z

oh hey, it looks like it does a bunch more stuff too: https://github.com/trhura/clojure-term-colors

dave 2020-06-15T15:49:34.240100Z

i haven't even tried the fancier stuff, like FG vs. BG colors, blinking text (wat?), underlining

Olical 2020-06-15T15:50:00.240300Z

I can promise you blink won’t work

Olical 2020-06-15T15:50:04.240500Z

😅

dave 2020-06-15T15:50:11.240700Z

i won't be too upset about that, lol

rafaeldelboni 2020-06-15T16:38:15.240900Z

I came here to say the same hahaha

rafaeldelboni 2020-06-15T16:39:16.241100Z

I really liked the old approach of having a .conjure file

2020-06-15T18:11:26.241300Z

Olical 2020-06-15T19:31:28.241500Z

Hmm that only existed because Conjure ran a JVM that needed configuring. Now it's all in nvims process that config should be done in the nvim way, which is g:... variables... I think. I don't know another plugin that uses it's own config file and syntax :thinking_face: if I did anything like this again it wouldn't be edn.

Olical 2020-06-15T19:31:54.241700Z

I kinda want to say "here's the value you need to set, do that where you normally do for all plugins"

Olical 2020-06-15T19:42:28.241900Z

This is now fixed on develop 🙂

martinklepsch 2020-06-15T22:14:03.242100Z

Screenshot of hell hahahhaah

Olical 2020-06-15T22:21:25.242300Z

Yeaaah, it's worse than it seems. The problem with my error handling system there is that it doesn't show the stack trace. So I just had to find it through intuition and knowledge of the code, I won't be so lucky next time.

Olical 2020-06-15T22:22:20.242500Z

I've got to add my own error handling in a bunch of deferred callbacks otherwise they just get swallowed (presumably by libuv?) I think.