Fork me on GitHub
#conjure
<
2021-04-01
>
dharrigan12:04:29

You know this implement highlight evaluation, which is pretty darn awesome

dharrigan12:04:49

do you think it's also a route to also highlighting when your cursor is inside a nested form?

Olical14:04:41

Hmm I mean, maybe, but I don't know if that's something I would add to Conjure since it's really nuanced. Although I guess you could argue it's a feature of showing you what would be evaluated with one specific mapping? I think I'd prefer this in another plugin personally, feels like it's erring on feature creep out of the domain I wanna worry about? :thinking_face:

dharrigan14:04:38

indeed, it would be neato as a plugin

dave14:04:57

I'm keen to try the eval highlighting, but I'm having trouble finding the new config option in the help text. :thinking_face:

Olical14:04:45

Oh damn! I forgot it, aaaaa, it's g:conjure#highlight#enabled = v:true

dave16:04:21

It works like a charm! Good stuff! 💯

dharrigan16:04:36

latest neovim == 5?

dharrigan16:04:47

I wonder when that's coming out....seems to be dragging on....

emilaasa20:04:28

Yeah it's been going on for a while. maybe this one works; 18 aur/neovim-nightly-bin 0.5.0+dev+1194+gc20ae3aad-1

emilaasa20:04:36

seems pretty bleeding edge 😛

dharrigan20:04:51

Ah, I'll stay away from 5.0 until it's released 😄

dharrigan20:04:00

4 is pretty darn good 😄

emilaasa20:04:07

chicken 😛

emilaasa20:04:59

3 weeks with Conjure now at the new job, everything works great and I basically just took your dotfiles

dharrigan20:04:37

oh, you're most welcome. I'm glad it helped. A starting point.

emilaasa20:04:17

Yep, works really well. I'm actually a bit surprised that I don't miss the smartness of IDEA / Cursive

emilaasa20:04:54

It has some overhead too all that fancy stuff

dharrigan20:04:37

Once you get into the flow, using clojure with vim + conjure is very condusive to being very productive

dharrigan20:04:04

I find I concentrate now more on the namespace, with a few interactions. Allows me to keep focused on what I'm trying to do.

dharrigan20:04:26

and eval'ing inside the buffer is so handy

emilaasa20:04:28

Yeah exactly, doesn't really help (it hinders) to scatter your attention all over the place.

dharrigan20:04:06

and thanks to the recent addition of eval'ing and placing the results of that eval as a comment beside the form/def, lets me see what each part does

emilaasa20:04:06

I like it a lot, been using eval at mark a lot too

dharrigan20:04:23

I use eval mark to, normally to restart my state 🙂

emilaasa20:04:49

I just did about 3 years heavy go / rust programming and this env is so much better 😛

dharrigan20:04:52

I flip betwen kotlin and clojure programming. I always feel a sense of liberation coming back to Clojure

dharrigan20:04:10

I do like Kotlin, and it pays my bills 🙂 But I much pefer Clojure 🙂

emilaasa20:04:30

Yeah it works, still you're pushed into some kind of TDDish thing even to get some feedback

emilaasa20:04:57

Having a look at some actual data can be a hassle 😃

emilaasa20:04:24

I think Kotlin is cool and I did use it a alot a few years ago with jetbrains products

dharrigan20:04:53

We use it at work for all backend stuff, so having to do it too. I find it very nice.

emilaasa20:04:24

Anyway got to go to bed now but thanks for being a poweruser and actually writing your stuff down 🙂

dharrigan20:04:30

you're most welcome. Oh, I don't consider myself a poweruser. I'm certainly very much a beginner too. As the saying goes, I'm standing on the shoulders of giants.

stopa19:04:53

Noticing a light bug, not sure if it’s me / if ya’ll have seen this before. When I set up shadow: ConjureShadowSelect app Now, if I eval in a clj file, I get some errors:

; (err) ------ WARNING - :undeclared-var -----------------------------------------------                                                                                                                        
; (err)  Resource: <eval>:2:4                                                                                                                                                                                   
; (err)  Use of undeclared Var virtual-library.goodreads/pmap                                                                                                                                                   
; (err) --------------------------------------------------------------------------------                                                                                                                        
; (err)                                                                                                                                                                                                         
nil                                                                                                                                                                                                             
#'virtual-library.goodreads/import-csv!       
As thought it’s sending that file to shadow too. Is there some wrong I’m setting things up? Folder structure:
src/clj -> clj files
src/cljs -> cljs files

Olical14:04:37

Have you added the src/clj and src/cljs dirs to your path? Those aren't built in directories, the only directory Clojure knows about is src and maybe test by default I think? I never use clj and cljs directories at the top level, but then I rarely mix clj+cljs in the same project.

Olical14:04:22

Also if you're in a CLJS REPL and try to eval a clj file (so not cljc or clj) it won't work properly afaik

stopa20:04:22

Hey Oliver! Indeed, let me give some context on what is happening: • I have both clj + cljs on the classpath • To run my project, ◦ I set up an nrepl ◦ Make two separate remote connections ▪︎ In one remote connection, I run the server ▪︎ In another, I kick off shadow ◦ This works fine ◦ From conjure’s perspective, any time I eval, I think it default goes to clj • But, if I run ◦ ConjureShadowSelect app ◦ Then, it sends all files to cljs (this, I am a bit vague on, as I don’t quite understand fully how shadow-cljs works) • Ideally, ◦ If it’s a “clj” file, it would send to the “clj” part of this repl, and if “cljs” it would send to the other part • But, if this is not supported, no problem ▪︎ In this case, is there a way to say the opposite of ConjureShadowSelect app? • (i.e to disable shadow, so conjure knows to send clj files to the right place again) I set up one remote nrepl connection. • This nrepl has both cljs and clj on the classpath • By default,

Olical11:04:32

So you might need to adjust the shadow-cljs path too? Not sure how to do that, but I have a feeling shadow-cljs has it's own classpath config? (maybe not called a classpath)

Olical11:04:58

A little background: When you connect to an nREPL it opens a "session" (the thing that Conjure represents as names of cat/dog breeds but they're just UUIDs that I'm adding a human representation to) Conjure has one session selected at a time, but your nREPL can have many sessions. (search in :h conjure-client-clojure-nrepl for the session mappings) When you shadow select, your current session becomes a ClojureScript session where evals are handled by shadow. You can open a new session that's plain clojure, then hop between sessions to hop between your clj and cljs evals.

Olical11:04:04

The alternative approach is to use :helpgrep ConjureClientState

Olical11:04:30

Then set up an autocmd in your vim so that on buf enter you look at the current file path then set the state string to clj or cljs, for example, each time you set the client state you get a kind of parallel universe of Conjure, so you can have one variant enabled while in the clj dir and another in the cljs dir. Each of which can have their own connections or sessions.

Olical11:04:18

I don't have a code snippet for this, but an autocmd that checks your current file's dir and sets the ConjureClientState is enough to flip your state back and forth. It's very simple so that it's flexible and you can fit into your own workflow / constraints.

Olical11:04:01

augroup conjure_set_state_key_on_dir_changed
  autocmd!
  autocmd DirChanged * execute "ConjureClientState " . getcwd()
augroup END
From the help text