Fork me on GitHub
#conjure
<
2021-01-20
>
emilaasa06:01:04

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 😛

emilaasa06:01:29

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

emilaasa06:01:06

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?

emilaasa07:01:48

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

Olical13:01:24

Ohh that's nice

emilaasa07:01:56

Is what I did!

bendy13:01:42

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

bendy13:01:22

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)

Olical13:01:04

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

Olical13:01:33

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

bendy13:01:08

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

Olical13:01:23

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

Olical13:01:08

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.

bendy13:01:18

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

Olical13:01:27

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

Olical13:01:44

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

Olical13:01:03

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

bendy13:01:21

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

bendy13:01:43

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!

🎉 3
dave14:01:17

\EiW should work

dave14:01:39

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

Olical14:01:44

Oh good point!

dave14:01:49

w vs. W is a built-in vim thing

Olical14:01:58

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

Olical14:01:10

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

dave14:01:22

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

dave14:01:50

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

Olical14:01:04

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

dave14:01:21

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.

dave14:01:36

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

dave14:01:20

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.

dave14:01:44

\Eie is super easy

bendy13:01:25

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

bendy13:01:01

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

Olical13:01:41

: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.

Olical13:01:05

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

Olical13:01:30

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.

bendy13:01:47

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

bendy13:01:09

Very well could be an issue with my specific config

thheller13:01:59

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