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 😛
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
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?
:redir! > vim_keys.txt
:silent verbose map
:redir END
Ohh that's nice
Is what I did!
I'm using reagent and shadow-cljs, and often find myself wanting to deref a value and inspect it or copy a value
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)
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
Otherwise go to the @
and then ve<prefix>E
I think? To eval the visual selection?
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
Thanks @olical!
Hmm, not yet, it's something that doesn't feel great and I can't think of a good solution for :thinking_face:
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.
Is there a way to evaluate and repalce a visual selection? aka use e!
functionality on a visual selection
You could make a mapping that visual selects the whole thing, evals then pastes the result (stored in the c
register by default)
So there's no one mapping to do that, but a custom one should be pretty simple
ve"cp
would replace the word with the last eval result
awesome, thanks! I'll get back if I find a solution 🙂
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!
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
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
: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.
Like it might be more on your second connection things are fine?
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.
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
Very well could be an issue with my specific config
looks to me like the error is trying to eval nrepl-select
from CLJS when it is CLJ only?
\EiW
should work
If you have your cursor on the foo
part of @foo
:
* iw
selects foo
* iW
selects @foo
Oh good point!
w
vs. W
is a built-in vim thing
Although I think that includes other things, so it's whitespace as a boundary?
So if there's a paren at the front it'll include the paren on the eval?
When's the last time you wrote (@foo)
? 🙂
Ah, the closing paren is more likely to be a problem though.
Fair point! (:foo @bar)
is more common though
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.
At this point, I would have already visually selected what I want and pressed \E
🙂
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.
\Eie
is super easy