Fork me on GitHub
#conjure
<
2020-06-29
>
markwoodhall13:06:35

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

Olical14:06:10

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

Olical14:06:29

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

markwoodhall14:06:15

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.

Olical14:06:55

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.

Olical14:06:10

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

Olical14:06:15

I’ll get it fixed ASAP.

markwoodhall14:06:11

Great, thanks! No hurry.

martinklepsch14:06:48

does conjure rely on cider-nrepl ?

Olical14:06:16

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.

Olical14:06:33

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.

Olical14:06:03

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.

Olical14:06:44

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

dharrigan14:06:11

Is that required if you have a repl already running?

dharrigan14:06:27

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

Olical14:06:30

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

Olical14:06:43

If you have a REPL already, stick with that 😄

dharrigan14:06:44

and vim-dispatch by tpope?

Olical14:06:30

Yeah, I installed all three from the readme

Olical14:06:52

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

Olical14:06:46

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

dominicm16:06:46

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

dominicm16:06:53

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

Olical16:06:41

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

Olical16:06:50

I use kitty so maybe I should explore that too

dominicm16:06:37

" 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

dominicm16:06:45

#!/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)

rafaeldelboni21:06:54

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

Olical21:06:49

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

rafaeldelboni21:06:59

sorry for that

Olical21:06:31

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

rafaeldelboni21:06:46

The docs are great, btw