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)
emilaasa 2021-01-20T06:42:04.056200Z

Is there a cheat sheet / key binding list that I've somehow missed? I ended up on practicallis guide for looking up the eval bindings for example. I'll add im not a vim help expert 😛

emilaasa 2021-01-20T06:48:29.057600Z

Another thing I've been trying is vim-jack-in. Works great if I open vim without any file args, then :Clj and :e myfile.clj

emilaasa 2021-01-20T06:49:06.058400Z

But if I vim myfile.clj and then do :Clj I cant get Conjure to find the repl - any tips on how to do this?

emilaasa 2021-01-20T07:16:48.058700Z

:redir! > vim_keys.txt
:silent verbose map
:redir END

Olical 2021-01-20T13:13:24.062300Z

Ohh that's nice

emilaasa 2021-01-20T07:16:56.059Z

Is what I did!

2021-01-20T13:10:42.059700Z

I'm using reagent and shadow-cljs, and often find myself wanting to deref a value and inspect it or copy a value

2021-01-20T13:13:22.062200Z

Two questions: 1. What's the proper way of evaluating @atom-name? \ew, \ee, \er all don't evaluate the deref 2. Is there a way to replace the form in the editor with the return value? so @atom-name becomes :atom-value (some combination of \e! and a motion)

Olical 2021-01-20T13:14:04.062700Z

I use (deref thing) instead in this case since @ isn't part of the word, not sure how we'd configure it to count it as one. I think it'll be a vim config thing then ew would work

Olical 2021-01-20T13:14:33.062900Z

Otherwise go to the @ and then ve<prefix>E I think? To eval the visual selection?

2021-01-20T13:15:08.063100Z

I've been doing the (deref thing) method, I just figured that there must be an easier way, given all of conjure's other niceties

2021-01-20T13:15:14.063300Z

Thanks @olical!

Olical 2021-01-20T13:15:23.063500Z

Hmm, not yet, it's something that doesn't feel great and I can't think of a good solution for :thinking_face:

Olical 2021-01-20T13:16:08.063700Z

Maybe I can find a way to include @ in ew (but I don't know what the vim config is for that, maybe lisp-words?) I don't think it'd work with e! though since that's intended for forms, not a single symbol.

2021-01-20T13:16:18.063900Z

Is there a way to evaluate and repalce a visual selection? aka use e! functionality on a visual selection

Olical 2021-01-20T13:16:27.064100Z

You could make a mapping that visual selects the whole thing, evals then pastes the result (stored in the c register by default)

Olical 2021-01-20T13:16:44.064300Z

So there's no one mapping to do that, but a custom one should be pretty simple

Olical 2021-01-20T13:17:03.064500Z

ve"cp would replace the word with the last eval result

2021-01-20T13:17:21.064700Z

awesome, thanks! I'll get back if I find a solution 🙂

2021-01-20T13:28:43.064900Z

Using vim-sexp, I can select the atom with vie, or evaluate it with \Eie, and then replace it with ve"cp. I've added my own mappings for \edd and \ed!. Thanks for the advice!

🎉 1
2021-01-20T13:34:25.066800Z

Also I'm not sure if this is a conjure related issue or a shadow-cljs, but sometimes if I connect using :ConjureConnect, I get an error when running :ConjureShadowSelect build. If I connect using \cf, I don't get the error when running :ConjureShadowSelect

2021-01-20T13:37:01.067800Z

I put my commands after TODO tags so they are highlighted. It's not an issue for me now and I'm not sure if it's worth filing a bug report, but might as well mention it and my workaround

Olical 2021-01-20T13:38:41.068600Z

:thinking_face: that looks like it could be a timing issue? But I don't think it's Conjure related? There's no difference between using cf and the command.

Olical 2021-01-20T13:39:05.068800Z

Like it might be more on your second connection things are fine?

Olical 2021-01-20T13:39:30.069Z

I feel like this is a shadow-cljs thing since there's no difference between the way you started the connection, it results in the same thing.

2021-01-20T13:41:47.069300Z

It's been a long standing issue, no matter how many times I run :ConjureConnect it will give me the same error. Everytime I see that error I know to connect with \ef

2021-01-20T13:42:09.069500Z

Very well could be an issue with my specific config

thheller 2021-01-20T13:58:59.069700Z

looks to me like the error is trying to eval nrepl-select from CLJS when it is CLJ only?

dave 2021-01-20T14:19:17.069900Z

\EiW should work

dave 2021-01-20T14:19:39.070100Z

If you have your cursor on the foo part of @foo: * iw selects foo * iW selects @foo

Olical 2021-01-20T14:19:44.070300Z

Oh good point!

dave 2021-01-20T14:19:49.070500Z

w vs. W is a built-in vim thing

Olical 2021-01-20T14:19:58.070700Z

Although I think that includes other things, so it's whitespace as a boundary?

Olical 2021-01-20T14:20:10.070900Z

So if there's a paren at the front it'll include the paren on the eval?

dave 2021-01-20T14:20:22.071100Z

When's the last time you wrote (@foo)? 🙂

dave 2021-01-20T14:20:50.071300Z

Ah, the closing paren is more likely to be a problem though.

Olical 2021-01-20T14:21:04.071500Z

Fair point! (:foo @bar) is more common though

dave 2021-01-20T14:21:21.071700Z

Like if you have an expression like (+ 1 @foo), and you have your cursor on foo, if you type \EiW you'll be evaluating @foo) which is not what we want.

dave 2021-01-20T14:21:36.071900Z

At this point, I would have already visually selected what I want and pressed \E 🙂

dave 2021-01-20T14:22:20.072100Z

I think using vim-sexp's Lisp-specific objects is the way to go, though, if you really want to avoid the hassle of visually selecting what you want to eval.

dave 2021-01-20T14:22:44.072300Z

\Eie is super easy