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)
jose 2020-07-01T15:49:35.340100Z

was the log toggle option removed? I think in previous versions there was a toggle log mapping

Olical 2020-07-01T15:51:18.341700Z

Ah, that’s just not implemented since it’s more of a regular window now. The current best approach is ,lv to open and ,lq to close. A toggle could be added but it might not make much sense in the context of multiple log windows and the HUD open. Old Conjure only had a concept of one window, the new conjure is designed around “open the windows you want, I’ll pop something up if there’s something you’re going to miss”

Olical 2020-07-01T15:51:36.342200Z

So toggle may make less sense unless you only ever open a single log window at a time :thinking_face:

jose 2020-07-01T15:58:47.344900Z

I see, usually I open only one log window, I think it make some sense, but don't worry, I'm fine using <leader>lq . Out of curiosity, do you think it would be easy to create a custom map on my nvim config for it?

Olical 2020-07-01T20:05:20.345300Z

:thinking_face: I suppose you could list tab windows and then if there was one, you invoke the close mapping.

Olical 2020-07-01T20:05:52.345800Z

Also, which way would it open... vertical or horizontal :thinking_face:

dave 2020-07-01T20:12:38.347100Z

@jlle here are some hacks i have in my dotfiles, allows me to toggle the conjure log (i prefer the <localleader>lt one, which opens the log in a tab instead of a split) on/off by pressing <localleader>cc

function! ToggleConjureLog() abort
  if expand('%:t') =~ ".*conjure-log-.*"
    execute 'Bclose'
  else
    " Ideally I could call some function provided by Conjure directly to do
    " this, but I wasn't able to figure out how to do that. This mapping will
    " need to be adjusted if I ever configure Conjure to use a different mapping
    " to open the log in a tab, or if Conjure ever changes the default mapping.
    " I think those two things are both pretty unlikely to happen, so meh.
    "
    " Another thing worth noting: normal apparently doesn't work with <leader>
    " and <localleader>, so you have to do some hackery like what's going on
    " here (<https://vi.stackexchange.com/a/7780/25687>) or just give up and type
    " your actual (local)leader key in the mapping. I'm doing the second one.
    normal \lt
  endif
endfunction

augroup additional_conjure_bindings
  autocmd!

  autocmd FileType clojure,fennel
        \ nnoremap &lt;buffer&gt;
        \ &lt;localleader&gt;cc :call ToggleConjureLog()&lt;CR&gt;

  " press q to close the log buffer
  autocmd BufEnter conjure-log-* nnoremap &lt;buffer&gt; q :Bclose&lt;CR&gt;
augroup END

dave 2020-07-01T20:13:19.347700Z

i also like to be able to press q to close certain types of buffers. sort of controversial, but anyway, i set up a mapping for that too

Olical 2020-07-01T20:13:46.348400Z

I love seeing this sort of thing! And it helps me spot areas where I can help if you're having to jump through hoops to to something essential

🙂 1
dave 2020-07-01T20:13:57.348700Z

also worth noting that my localleader is \. you'll want to change that to , or whatever your local leader is

dave 2020-07-01T20:15:38.349200Z

oh, one more thing. i have a Bclose function defined, and the code above relies on it

" Don't close window when deleting a buffer
command! Bclose call &lt;SID&gt;BufcloseCloseIt()
function! &lt;SID&gt;BufcloseCloseIt() abort
   let l:currentBufNum = bufnr("%")
   let l:alternateBufNum = bufnr("#")

   if buflisted(l:alternateBufNum)
     buffer #
   else
     bnext
   endif

   if bufnr("%") == l:currentBufNum
     new
   endif

   if buflisted(l:currentBufNum)
     execute("bdelete! ".l:currentBufNum)
   endif
endfunction

dave 2020-07-01T20:16:05.349800Z

basically it closes the buffer. feel free to replace that part with whatever you want. believe it or not, there are vim plugins solely devoted to closing buffers! 😅

dave 2020-07-01T20:16:24.350Z

:bd! would probably work fine here

markx 2020-07-01T23:45:19.351900Z

Just a random question: how feasible is it to add a general nrepl client to Conjure? If this works, maybe conjure can work with more languages with nrepl server implementation?

Olical 2020-07-02T08:24:28.352500Z

By design 😄 I'm planning on extracting the TCP client code into it's own thing then building a generic nREPL client on top of that. This is the same as the STDIO client I want to implement.

Olical 2020-07-02T08:25:02.352700Z

So it might take a little bit of config to hook it up, but you can then set up any file type to use one of Conjure's super generic implementations until there's a more specific implementation.

Olical 2020-07-02T08:25:30.352900Z

I'd love to have every scheme working over STDIO (even in a limited slightly excavated way)

Olical 2020-07-02T08:25:52.353100Z

And things like Racket that have nREPL implementations of some sort working to some degree.

Olical 2020-07-02T08:38:36.353300Z

I'll mention in the channel when I have generic implementations and write up a wiki page or help text on how to hook them up to things. Hopefully it'll bring so much more support! Then for the most used and loved they can eventually be replaced by a custom client that adds deeper integration with the target.

markx 2020-07-02T15:45:49.364400Z

That’s awesome! Thanks for your great work.