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)
orestis 2020-08-06T12:03:04.125800Z

Hey there, Conjure looks slick. I’m doing the :ConjureSchool and I’m having trouble with Eiw:

; eval (selection): lesson
; Compile error in 'lesson' 

orestis 2020-08-06T12:03:25.126200Z

Where my cursor is like this:

school.les<cursor>son-6-message

orestis 2020-08-06T12:03:47.126700Z

I suspect I have to somehow tell vim that words in Lisps can contain dashes?

Olical 2020-08-06T12:15:06.127600Z

Oh yeah! I think someone else hit this a while back, let me recall where that setting comes from

Olical 2020-08-06T12:18:55.128100Z

So I think it's defined by the iskeyword option but I can't work out which plugin of mine is adding - to it

Olical 2020-08-06T12:29:46.129300Z

Ah so if you :set lisp it should work as expected @orestis, I need to have a think about this. Pretty sure my nvim is doing this automatically which is why I don't encounter it but I can't work out where it's coming from... maybe it's some other setting that happens to configure set lisp for me, I have no config for it in my dotfiles.

Olical 2020-08-06T12:31:09.129700Z

> 'autoindent' must also be on for this to work. Perhaps this is it!

Olical 2020-08-06T12:31:52.130400Z

I might just remove that part from the school or change it so it doesn't rely on the hypen. Or if I can get to the bottom of it I'll explain how to get your nvim to treat lispy words correctly inside the school

orestis 2020-08-06T12:38:51.130600Z

set lisp makes it work :)

Olical 2020-08-06T12:44:36.131400Z

Awesome! Well I can't find the thing in my config that sets this but it seems like almost all lispy syntax support plugins do it, so I guess I'll set it for you in the future too!

Olical 2020-08-06T12:44:44.131700Z

Thanks for hi-lighting this issue.

orestis 2020-08-06T12:57:50.132500Z

Another quick question: Cider (and Calva) special-case the (comment …) form so that top-level evaluation ignores it. Makes it really easy to work with rich-comments.

orestis 2020-08-06T12:58:13.133100Z

the question is, does Conjure have something like that, or if not can I override it somehow?

Olical 2020-08-06T12:58:26.133200Z

All lispy syntax plugins set this, it doesn't get set when I do a hack to give you syntax for fennel files in the school. Worked it out and will work around it.

Olical 2020-08-06T13:00:43.133400Z

Hmm this has been thought about quite a few times but never implemented. I still have something similar on my "maybe" backlog. My usual approach for things in comments blocks if I want them to be runnable as a group is to wrap them in a do this way it works for me and my colleagues in spacemacs

Olical 2020-08-06T13:00:48.133600Z

Still happy to consider it though!

orestis 2020-08-06T13:02:36.133800Z

You still have to navigate to the end of the do block, right?

Olical 2020-08-06T13:05:07.134Z

Oh no! Not at all, Conjure's mappings seek the beginning and end of the form

Olical 2020-08-06T13:05:11.134200Z

Spacemacs do not

Olical 2020-08-06T13:05:14.134400Z

They require you go to the end

orestis 2020-08-06T13:16:26.134600Z

Ah, so you can put the cursor on the do itself, and ee will do the right thing

Olical 2020-08-06T13:29:53.134800Z

Yep, anywhere on the do will evaluate the do as a whole.

Olical 2020-08-06T13:29:58.135Z

Unless you go another form deeper

Olical 2020-08-06T13:30:19.135200Z

(do| (+ 1 2)) where | is the cursor will eval the do

Olical 2020-08-06T13:30:31.135400Z

(do (|+ 1 2)) will evaluate the +

Olical 2020-08-06T13:30:59.135600Z

With <prefix>ee, whereas <prefix>er will evaluate the top level form regardless

Olical 2020-08-06T13:31:36.135800Z

There was talk about making er ignore the comment block part, but I'm still not sure about that.

πŸ’― 1
Olical 2020-08-06T13:31:44.136Z

That would get you the behaviour we're talking about

Olical 2020-08-06T13:32:08.136200Z

The other thing you can do, put a mark on the do you're interested in then use <prefix>em{mark key} to evaluate the form at that mark.

Olical 2020-08-06T13:32:10.136400Z

Which I use a lot

πŸ‘ 1
orestis 2020-08-06T13:39:50.136600Z

The mark is definitely useful.

orestis 2020-08-06T13:40:35.136900Z

the way I see it, evaluating the top-form when it’s a comment is always going to be a nil, so opting-in to the tweaked behaviour is probably not dangerous for most people.

orestis 2020-08-06T13:41:27.137900Z

I’m floored at how fast nvim+Conjure is to eval things. I went from Emacs to VSCode which was definitely a huge hit in performance, but I’m amazed about how I get color-coded results back so quickly.

2020-08-07T11:34:34.168500Z

it’s semi related but I loved this post from earlier in the year about next gen CLIs https://blog.repl.it/clui

Olical 2020-08-07T11:38:06.168800Z

πŸ‘€ thanks for the link!

Olical 2020-08-07T11:41:31.169Z

Ugh, this makes me want to make things, stop it

πŸ˜‚ 1
Olical 2020-08-07T11:41:51.169200Z

remaining 15 minutes of free time a week screaming in the corner of the room

orestis 2020-08-06T13:49:48.138200Z

Big thanks @olical for doing all this work πŸ™‚

❀️ 1
πŸš€ 1
2020-08-06T13:51:30.138300Z

Did you find Emacs faster then VSCode? I was using Spacemacs on an ~2015 Macbook Pro some time ago and it was staggeringly slow for me …

dharrigan 2020-08-06T13:59:13.138600Z

I would like to see a way for the comment block to be ignored. I have several forms inside of one (to try things out). I don't really want to wrap the entire thing in a do (or each of the forms inside the comment))

dharrigan 2020-08-06T14:00:13.138800Z

So a nice way to pretend that if evaluating a form, for the comment block to be ignored gets my vote! and when evaluating the entire file/buffer for the comment block to act like a comment block and the forms inside aren't evaled πŸ™‚

dharrigan 2020-08-06T14:00:16.139Z

πŸ™‚

orestis 2020-08-06T14:10:38.141Z

I used vs code but after plain Emacs, not spacemacs. Emacs was definitely faster than vscode but I attribute that also to the plugins, Cider is much more polished and efficient.

orestis 2020-08-06T14:11:00.141700Z

Plain Emacs was plain fast but the nvim startup is comically fast.

Olical 2020-08-06T14:16:51.142Z

I'm rethinking my standpoint on eval root form :thinking_face: I'll take a look at it in my next chunk of work

Olical 2020-08-06T14:17:34.142300Z

You're more than welcome! I hope you enjoy and I hope I can keep improving it for you! No hard feelings if you go elsewhere for you evaluation needs too 😊

Olical 2020-08-06T14:18:36.142500Z

I tried to like emacs / spacemacs (tried both angles) for about a year, then went back to vim+fireplace but missed some things from emacs land. Now we have Conjure + Aniseed πŸ˜… although it took 3-4 years...

Olical 2020-08-06T14:19:06.142700Z

Startup time and statefulness in weird places + non-evil key bindings leaking through and surprising me really put me off

dharrigan 2020-08-06T14:22:05.142900Z

πŸ™‚

2020-08-06T14:37:10.143100Z

I assume something was wrong with either the machine or my setup, but Spacemacs was slow for me to the extend it was difficult to use …

2020-08-06T14:37:50.143300Z

@olical what were the things you missed from Emacs-land? I really tried liking it and really like the idea of easily customisable/moldable environment

Olical 2020-08-06T14:41:01.143800Z

I think the only thing was interactive lispy interaction with the editor itself, which is why I built aniseed

Olical 2020-08-06T14:41:24.144Z

But I didn't really like elisp so I think Fennel running in LuaJIT is better in basically every way (for me)

orestis 2020-08-06T14:42:45.144800Z

The only thing I miss from Emacs is m-x was

Olical 2020-08-06T14:42:48.145Z

Other than that, I thought the freedom in UI led to inconsistencies. Major and minor modes confused me and felt too idealistic and narrow (probably just didn't understand them). I'd regularly get into states where something was off and I'd just have to restart. Package management felt absolute awful and FAR too complex in comparison to what I have in nvim

Olical 2020-08-06T14:45:02.145200Z

I suppose you could use something like :Clap command for that https://github.com/liuchengxu/vim-clap

Olical 2020-08-06T14:45:07.145700Z

For m-x I mean

pez 2020-08-06T14:45:40.146700Z

I love the mark thing. Would be super sweet to have something like that in Calva.

Olical 2020-08-06T14:46:16.147700Z

I think vim-iced added it after seeing it in Conjure, might as well continue the trend πŸ˜„ I think it's a great way to eval things.

Olical 2020-08-06T14:47:09.148700Z

One core part of the functionality though is that you should be able to do it from another file, if you can do that? So if I do mM on some thing I'm interested in running then go to another file elsewhere in the project I can hit ,emM and have it eval the mark in the original file under the right context.

Olical 2020-08-06T14:47:32.149400Z

So if you add it, definitely try to get that part! It's suuuuper useful in some very specific things. Saves you buffer hopping over and over.

Olical 2020-08-06T14:48:07.150200Z

(also uppercase marks in nvim are persisted to disk (I think), so these magic eval mappings persist between restarts!)

pez 2020-08-06T14:48:14.150400Z

Apropos the special case of regarding comment form as creating a new top level. I've never heard anything remotely like a complaint about Calva behaving like that. And I would sorely missed it myself if it wasn't there.

pez 2020-08-06T14:50:27.153700Z

Thanks for the pointer about cross-file marks. That will definitely need a bit tricky to get into Calva, but the whole mark thing would be tricky anyway. Haha

orestis 2020-08-06T14:51:06.155100Z

Expanding on my m-x comment - Emacs felt as it didn’t require me to bind every little obscure thing into a key, as I could m-x and start typing, with autocomplete usually finding the right thing. Vim suffers from too much terseness in the commands...

Olical 2020-08-06T14:51:16.155300Z

@pez Thank you very much for the feedback! That's hugely reassuring, I've been on the fence because I'm scared of someone evaluating a root form on a comment expecting it to do nothing but return nil (I don't know why you'd do this but still) and instead having EVERYTHING inside the comment executed. Which could be VERY bad.

Olical 2020-08-06T14:51:33.155500Z

Got it yeah, I agree with you there

Olical 2020-08-06T14:51:45.155700Z

So you map what you need access to quickly and m-x for everything else

Olical 2020-08-06T14:53:08.155900Z

My original approach for the comment block conundrum was to allow numerical prefixes to eval root and eval current form. So 1,er or something would eval one form in from the root.

Olical 2020-08-06T14:53:21.156100Z

But it's a bit too clever and pretty hard to implement until I get tree-sitter support everywhere.

orestis 2020-08-06T14:54:56.156800Z

Yep. I also need to figure out paredit in insert mode.

Olical 2020-08-06T14:56:09.157400Z

I use vim-sexp and have done for years, I never really fell in love with paredit. vim-sexp feels a lot more vimmy to me

Olical 2020-08-06T14:56:14.157700Z

Also never got on with parinfer

orestis 2020-08-06T14:56:37.158500Z

A big Emacs plus is also accepting that mouse is a thing for things like hover on a word to see eg a longer error. Not sure if neovim adds something there.

Olical 2020-08-06T14:58:32.158700Z

I think that's required if you're burying info inside things and inventing new UIs for stuff. If everything you do ends up in a buffer (maybe with some folding?) then you don't need to expand things. Trade offs for sure. I don't think nvim brings anything new to the table here, I have set mouse=a which allows me to interact and select nicely, but it's not useful other than that. The main difference there I guess is emacs isn't tied to the rules of a terminal (unless you use the tui)

Olical 2020-08-06T14:59:20.158900Z

I kinda like the terminal restrictions since it forces you to do everything in text, which can allow more things to plug together. I felt like some of emacs UIs were a whole new thing I had to learn with their own rules. Vim is just commands, mappings and buffers.

Olical 2020-08-06T14:59:51.159100Z

Having images and varied font sizes could be nice, but it's not a dealbreaker

pez 2020-08-06T15:07:38.159300Z

Not sure I understand you correctly, but for the record. Calva does not evaluate everything inside the comment form. Instead it behaves like if the comment form creates a top level, so if you evaluate top level form, when inside a comment form it will evaluate it as if the comment form was the whole file. Example:

(comment
  1
  (vec (repeat 2 |[:foo :bar]))
  3)
If you issue the eval top level command with the cursor there before the vector it will evaluate the (vec ...) form.

pez 2020-08-06T15:09:59.159500Z

(The Evaluate current form command has no such special case.)

Olical 2020-08-06T15:13:11.159700Z

Oh! :thinking_face: I was thinking that it would turn comment into an implicit do. I've clearly misunderstood. So eval root form would basically not count the comment as a form and instead look at whatever top level form below that your cursor was in.

πŸ‘ 1
orestis 2020-08-06T15:14:19.160700Z

Yeah not an implicit do - it’s as if the comment wasn’t there at all so you can go line-by-line

πŸ‘ 2
pez 2020-08-06T15:15:55.161200Z

Then I can see how you were reluctant to add it. πŸ˜ƒ

😬 2
rgm 2020-08-06T18:20:24.163200Z

Is there an equivalent to fireplace’s :Eval? I used this a fair bit for eg. map ,r :wa\|Eval (juxt.clip.repl/reset)<CR> to kick off a tools-namespace-ish refreshes in integrant/clip/mount

dave 2020-08-06T18:26:33.163600Z

@rgm :ConjureEval (+ 1 2)

dave 2020-08-06T18:27:12.164400Z

i have a similar mapping, ,ep => :ConjureEval<space>

rgm 2020-08-06T18:27:28.164900Z

doh! in the main doc and not the nrepl one. Thanks.

dave 2020-08-06T18:27:55.165300Z

i think refresh is also supported out of the box with conjure, although it might require nrepl middleware

dave 2020-08-06T18:27:58.165500Z

try ,rr

rgm 2020-08-06T18:28:34.166200Z

ah, ok. saw that refresh, but wasn’t sure if it was a ctns-style unload-reload

rgm 2020-08-06T18:28:58.166400Z

πŸ™

Olical 2020-08-06T19:54:08.166500Z

Yep! Sorry, that's usable in every client so it's in the core docs, I do feel like I could make these thing easier to find. Right now you need to know to check :h conjure and :h conjure-CLIENT

Olical 2020-08-06T19:54:10.166700Z

Which kinda sucks

Olical 2020-08-06T19:54:18.166900Z

Not sure what I could do about it though

Olical 2020-08-06T19:55:20.167700Z

Yep! The refresh tooling is built in and supports a "before" as well as "after" function https://github.com/Olical/conjure/blob/d9d514db3ef7fcf36bacc402aba511663a73bfbc/doc/conjure-client-clojure-nrepl.txt#L185-L198

⭐ 1
rgm 2020-08-06T21:27:15.168100Z

All good. No worries.

2020-08-06T23:33:00.168300Z

πŸ› 1