Fork me on GitHub
#conjure
<
2020-04-23
>
Olical10:04:46

Alright, time to fix some bugs πŸ˜…

Olical10:04:10

Damn users, breaking my things! (thank you for breaking my things ❀️)

Olical10:04:03

* Autocompletion will now just silently fail when you don't have a connection or the server doesn't support it now. (@sergiusz) * I've moved "view source" and the *e *1 *2 *3 mappings to a v prefix for "view" since they weren't really to do with eval anyway. (@nate, avoids conflicting with your mapping too) * Fixed and improved interrupt so now it'll interrupt the right eval on the right session and then fallback to sending a generic interrupt to your session. This allows you to kill long running evals that Conjure doesn't know about that may be running in the session. (this is mapped to <prefix>ei) * I can't reproduce the log printing out of order or whatever when there's lots of output, will keep trying. * I can't reproduce the HUD getting stuck open when connection is lost, again, will keep trying. (@nate for those last two)

πŸ‘ 4
Sergiusz Bleja12:04:31

I can confirm it works for me. Nice one.

Sergiusz Bleja12:04:36

Just recently moved to using colemak, really like the leader-e* mappings now! 😁

Olical12:04:50

Nice! First bit of colemak specific feedback I've ever seen πŸ˜„

nate16:04:38

thank you for changing the view source mapping, I think that v for view works well as a mnemonic

nate16:04:10

I only had the stuck HUD once, even though I did the actions that led to it being stuck multiple times

nate16:04:18

I'll report back if it happens again

Olical10:04:52

I can't see how the HUD / log can get into these race conditions since access to the state is restricted to the logging module via access functions which are all running in a single thread.

Olical10:04:18

Obviously it can get messed up, I just have no idea how right now. Something about all the async callbacks involved with the Clojure client I guess.

rafaeldelboni13:04:55

Hey @olical I was reading the docs, before trying out the develop version I have two questions (sorry I'm dumb) β€’ The ["K"] means that is doesn't need localleader for using this command? I mean, I usually remap conjure's K and gd to use localleader as well and let the default ones for the LSP which load faster. So if I what to let this behaviour I can just configure "K" and "gd" to get this? β€’ The conjure config is saved in ~/.config/conjure/conjure.edn ? I didn't found anywhere in the docs saying where the config is saved.

Olical14:04:31

There's no conjure specific config file anymore it just goes in your vim config ☺️

Olical14:04:59

So yeah, you can alter that ["K"] to something like "sd"

rafaeldelboni14:04:44

But I can't do something like <localleader>K?

Olical14:04:05

Of course! That's just "K" without the array wrapper

rafaeldelboni14:04:49

Ah nice! Thanks I will try to swap for develop this afternoon, for coc I just need to use coc-conjure-olical plugin right?

Olical14:04:48

Yep! Then it should work as usual! I've added g:conjure_config if you're lazy loading conjure and you can't call the ConjureConfig command yet.

Olical14:04:56

It's in the helpfile

rafaeldelboni18:04:24

Hey @olical sorry to disturb, but where in the vim config is saved the conjure config?

rafaeldelboni18:04:40

I use two machines and I like to sync configs between them

Olical18:04:47

Oh it can be anywhere in your neovim config, so in your init.vim or something

Olical18:04:11

Wherever you added conjure as a plugin will do too, any vimscript file really

rafaeldelboni18:04:20

no showing for me

Olical18:04:27

If conjure is loaded you can use ConjureConfig, if it isn't loaded yet you can use g:conjure_config

rafaeldelboni18:04:27

do I need to run something to save?

rafaeldelboni19:04:02

:def-word "gd" :doc-word "K" doc-word is working, but def-word is not

Olical19:04:33

It needs to be saved into your vim config

Olical19:04:51

ConjureConfig doesn't persist

Olical19:04:03

So wherever you install or configure other plugins from

Olical20:04:16

So in my ~/.config/nvim/init.vim I could put some lines that began with ConjureConfig. As long as it was after plug#end() since that's when the plugins get loaded.

Olical20:04:45

If you want to lazy load Conjure you have to use let g:conjure_config = {...} which will be read by Conjure when it loads up.

rafaeldelboni20:04:52

yeah using let g:conjure_config = {"mappings.doc-word": "K", "mappings.def-word": "gd"} on my init.vim worked fine

Olical20:04:19

Oh sweet! Even def-word? You said you had an issue with that?

Olical20:04:03

(sorry if I wasn't much help, watching a movie with my girlfriend πŸ˜… )

rafaeldelboni20:04:18

sorry to disturb 😨

Olical20:04:34

Oh no, not a problem at all!!!

Olical20:04:56

If I can't reply, I can't reply, I was just worried I wasn't answering your question and I was misunderstanding

Olical20:04:38

Send questions whenever you want, I want to help as much as I can. If the docs aren't clear I want to improve them, so please do say if what I've written so far is just bad πŸ˜„

rafaeldelboni20:04:53

β€’ sure thing thanks a lot

rafaeldelboni20:04:02

I will send another one in the main thread

Olical20:04:49

Hah sounds good! Let's work it out!

dave17:04:19

i'm in the process of trying out the develop branch now, loving it so far! i'm curious, at this point, what are the features missing when your nrepl doesn't include the cider middleware?

dave17:04:53

i noticed that gd doesn't work and there is a message "Unsupported operation: info", whereas K does work

dave17:04:13

ah, i guess those are two different things, look up docs vs. go to definition

Olical19:04:07

Yep, different things! go to def works MUCH better with info compared to my hacky approach. Info may end up in the core nREPL middleware alongside a simple complete soon too!

dave19:04:53

awesome!

dave17:04:32

i'm really loving having the nrepl session persist after i restart neovim! very handy if i'm messing with my vim config and i get into a weird state and want to nuke neovim and start over

πŸŽ‰ 4
dave17:04:57

i also really like the new config system, well done

πŸŽ‰ 4
dave18:04:28

sharing my personal tweaks here in case they're helpful to anyone:

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => conjure
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
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 () 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
        \ nnoremap <buffer>
        \ <localleader>cc :call ToggleConjureLog()<CR>

  " mnemonic: eval prompt
  " (like how <localleader>ee is eval expression)
  autocmd FileType clojure
        \ nnoremap <buffer>
        \ <localleader>ep :ConjureEval<space>

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

dave18:04:13

Bclose is another custom thing i have in my vimrc. it basically just closes a buffer in the way that i like to do that

dave18:04:20

with the tweaks above, i can press <localleader>cc to show the conjure log in a tab (i.e. fullscreen) and then press it again to close it. it toggles showing/hiding the log, in other words

Olical19:04:23

I use <prefix>lt to open it in a tab then <space>q to close (my own mapping)

nate18:04:56

@dave thanks for sharing!

dharrigan18:04:52

That should be captured perhaps on the github page as User Submissions? Or on the Wiki?

dharrigan18:04:00

As an example

dave18:04:10

eh, i'd hesitate to share it out in the open like that. it's very particular to my own preferences and vim setup πŸ™‚

dave18:04:56

like maybe there are some issues with making q close the buffer on some people's vim setups. who knows?

dominicm18:04:25

Well, how will you record a macro!

dave18:04:47

see? case in point πŸ˜„

dave18:04:37

for the record, i do use macros extensively, i've just also gotten used to pressing q to close certain types of buffers that i consider more ephemeral. i would never think to define a macro in those buffers

dave18:04:03

probably a bad idea to recommend this practice to others

nate18:04:51

q works in some temp buffers for fugitive, so I think it's not a bad idea

dave19:04:35

yep, that's how i got used to pressing q

dave19:04:43

i found myself doing it all the time and almost defining macros πŸ˜„

dave19:04:00

so i was like "fuck it, i'll just define a mapping that closes the buffer when i press q"

Olical19:04:51

fugutive has deprecated that key though, they use gq now

dave19:04:21

it's too late, i'm already used to pressing q!