Fork me on GitHub

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


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”


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


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?


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


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


@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'
    " 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 () or just give up and type
    " your actual (local)leader key in the mapping. I'm doing the second one.
    normal \lt

augroup additional_conjure_bindings

  autocmd FileType clojure,fennel
        \ nnoremap <buffer>
        \ <localleader>cc :call ToggleConjureLog()<CR>

  " press q to close the log buffer
  autocmd BufEnter conjure-log-* nnoremap <buffer> q :Bclose<CR>
augroup END


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


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

🙂 3

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


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 <SID>BufcloseCloseIt()
function! <SID>BufcloseCloseIt() abort
   let l:currentBufNum = bufnr("%")
   let l:alternateBufNum = bufnr("#")

   if buflisted(l:alternateBufNum)
     buffer #

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

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


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! 😅


:bd! would probably work fine here


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?


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.


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.


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


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


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.


That’s awesome! Thanks for your great work.