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)
markwoodhall 2020-06-29T13:59:35.323100Z

Hi, I've recently started to try and use Conjure again, I'm starting from a pretty clean setup and getting an error when running :ConjureSchool :

E5108: Error executing lua ...markwoodhall/.vim/plugged/conjure/lua/conjure/school.lua:65: attempt to concatenate a nil value

Olical 2020-06-29T14:02:10.323600Z

OH NO I know what that is, I recommend v3.5.0 for a little while if you’d like to use the school.

Olical 2020-06-29T14:02:29.324Z

I just need to update it to use the new config system in v4. I knew I’d miss something!

markwoodhall 2020-06-29T14:03:15.324600Z

Ok, thanks. I can do without the school for now. Everything else is working, I was just interested to see what it might teach me.

Olical 2020-06-29T14:04:55.325200Z

Yeah, it’ll work on 3.5.0, I just updated how the config works to make it just like every other vim plugin, no magic or new concepts.

Olical 2020-06-29T14:05:10.325800Z

The one thing I forgot to update was the school 🙃 I’ll add a canary test for it too I think

Olical 2020-06-29T14:06:15.326Z

I’ll get it fixed ASAP.

markwoodhall 2020-06-29T14:09:11.326400Z

Great, thanks! No hurry.

martinklepsch 2020-06-29T14:10:48.326800Z

does conjure rely on cider-nrepl ?

Olical 2020-06-29T14:11:16.326900Z

Only for autocomplete and go to def right now but nREPL 0.8 should provide those things (in a simpler form) out of the box I think.

martinklepsch 2020-06-29T14:11:31.327100Z

👍 thanks

Olical 2020-06-29T14:11:33.327300Z

And I’m going to add fallback attempts for go to def soon, so it’ll try it’s best if you don’t have CIDER.

Olical 2020-06-29T14:12:03.327500Z

The idea is to not require it for the essentials but it’s an optional upgrade if you want fancier features. Rather than me writing big hacky versions of what CIDER does really well.

Olical 2020-06-29T14:12:44.327700Z

I’ve been enjoying https://github.com/clojure-vim/vim-jack-in for booting a fully CIDERed REPL.

dharrigan 2020-06-29T14:38:11.328Z

Is that required if you have a repl already running?

dharrigan 2020-06-29T14:38:27.328200Z

and do you have the radenlign/vim-dispatch-neovim installed too?

Olical 2020-06-29T14:38:30.328400Z

Nope, that starts your REPL + CIDER a la, CIDER jack in.

Olical 2020-06-29T14:38:35.328600Z

I do, yep

Olical 2020-06-29T14:38:43.328800Z

If you have a REPL already, stick with that 😄

dharrigan 2020-06-29T14:38:44.329Z

and vim-dispatch by tpope?

Olical 2020-06-29T14:39:30.329200Z

Yeah, I installed all three from the readme

dharrigan 2020-06-29T14:39:35.329400Z

kk

dharrigan 2020-06-29T14:39:37.329600Z

curious.

dharrigan 2020-06-29T14:39:40.329800Z

thanks 🙂

Olical 2020-06-29T14:40:52.330Z

I think the first two are required and the neovim one is just a bridge of sorts? It shims some things in?>

Olical 2020-06-29T14:41:46.330200Z

> Note: This plugin depends on dispatch.vim and you need to have that plugin installed for this plugin to work From vim dispatch neovim

dominicm 2020-06-29T16:36:46.330400Z

fwiw, I don't use the neovim dispatch anymore. I wrote an integration with dispatch & kitty

dominicm 2020-06-29T16:36:53.330600Z

that way I can close vim and open it again without losing my REPL

Olical 2020-06-29T16:38:41.330800Z

Oh that’s neat. I mostly just start another repl in another terminal.

Olical 2020-06-29T16:38:50.331Z

I use kitty so maybe I should explore that too

dominicm 2020-06-29T16:39:37.331200Z

" plugin/kitty.vim
if exists('g:loaded_dispatch_kitty')
	finish
endif

let g:loaded_dispatch_kitty = 1

augroup kitty-dispatch-neovim
	autocmd!
	autocmd VimEnter *
		\ if index(get(g:, 'dispatch_handlers', ['kitty']), 'kitty') < 0 |
		\	call insert(g:dispatch_handlers, 'kitty', 0) |
		\ endif
augroup END
and
" autoload/dispatch/kitty.vim
if exists('g:autoloaded_dispatch_kitty')
	finish
endif

let g:autoloaded_dispatch_kitty = 1

function! dispatch#kitty#handle(request) abort
	if empty($KITTY_LISTEN_ON)
	  return 0
	endif

	if a:request.action ==# 'make'
	  " Using it for make is annoying (for now)
	  return 0
	  let command = dispatch#prepare_make(a:request)
	elseif a:request.action ==# 'start'
	  let command = dispatch#prepare_start(a:request)
	else
	  return 0
	endif

	if &shellredir =~# '%s'
	    let redir = printf(&shellredir, '/dev/null')
	  else
	    let redir = &shellredir . ' ' . '/dev/null'
	endif

	let kitty = 'kitty @ new-window --title='.shellescape(a:request.title).' '.'--cwd='.shellescape(a:request.directory)

	if a:request.action ==# 'start'
	  let kitty .= ' --new-tab --tab-title='.shellescape(a:request.title)
	endif

	if a:request.background
	  let kitty .= ' --keep-focus'
	endif

	call system(kitty.' '.&shell.' '.&shellcmdflag.' '.shellescape(command).redir)
	return !v:shell_error
endfunction

function! dispatch#kitty#activate(pid) abort
  let out = system('ps ewww -p '.a:pid)
  let listen_on = matchstr(out, 'KITTY_LISTEN_ON=\zs\S\+')
  let call = 'kitty @ '
  if !empty(listen_on)
    let call .= '--to '. listen_on . ' '
  endif
  let call .= 'focus-window --match pid:'. a:pid
  call system(call)
  return !v:shell_error
endfunction

dominicm 2020-06-29T16:40:45.331400Z

#!/usr/bin/env bash

socket="$(mktemp -u -p '' kitty_socket.XXXXXXXXX)"
kitty --listen-on "unix:${socket}" "$@"
Here's how I launch kitty to make that work (you need to enable remote control y'see)

rafaeldelboni 2020-06-29T21:12:54.332600Z

Hey I'm getting E121: Undefined variable: g:conjure#client#clojure#nrepl#eval#auto_require when trying to disable auto-require, I'm doing something wrong?

" Old conjure config
let g:conjure_config = {"mappings.doc-word": "K", "mappings.def-word": "gd", "clojure.nrepl/eval.auto-require?": v:false}
" New conjure config
let g:conjure#mapping#doc_word = "K"
let g:conjure#mapping#def_word = "gd"
let g:conjure#client#clojure#nrepl#eval#auto_require v:false

Olical 2020-06-29T21:13:49.333Z

You just need an = between the name and the value I think?

rafaeldelboni 2020-06-29T21:13:54.333200Z

uahauauh

rafaeldelboni 2020-06-29T21:13:56.333400Z

yeap

rafaeldelboni 2020-06-29T21:13:59.333600Z

sorry for that

Olical 2020-06-29T21:14:31.334Z

Haha no problem! Did I miss it in some docs?

rafaeldelboni 2020-06-29T21:22:25.336300Z

Commit for reference, if anyone need to update their conjure configs: https://github.com/rafaeldelboni/dotfiles/commit/cb5b188028a1a2e3723b7ba592a632b36713705d

rafaeldelboni 2020-06-29T21:22:46.336600Z

The docs are great, btw