Fork me on GitHub
#vim
<
2017-04-27
>
wallydrag08:04:01

Hi all, i wanted to ask about how do you guys connect to repl in vim. Currently i open vim and open lein repl separately on the terminal and then i connect to the port mentioned on the repl

wallydrag08:04:33

i want to make this quick , because its tedious to open repl and connect to it , everytime i open a project

wallydrag08:04:56

any improvement is worthy of the effort here

dominicm08:04:03

I have a command which opens lein or boot in a background neovim terminal

mikepjb08:04:50

#!/bin/bash -e

tmux attach -t repl && exit || echo 'no existing repl, creating a new one...'

if [ -e "project.clj" ]; then
    tmux new -s repl "lein repl :start :port 9999"
else
    tmux new -s repl "boot repl -p 9999"
fi

mikepjb08:04:52

I use this script to launch a lein/boot repl in tmux, I’ll then disconnect from the session and open vim and connect to it using http://github.com/michaelbruce/ice.nvim

reborg09:04:32

uhm, not doing anything explicit. I thought fireplace was reading .nrepl-port in local folder and connecting

dominicm09:04:53

it does, yeah

alexwheeler17:04:34

when I run lein repl then in that repl prompt (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)) it changes my namespace to cljs.user. Then I run from within vim :Piggieback (cljs.repl.node/repl-env). I can run commands from within vim with fireplace i.e. cpp, but when I use cpr to load-file and switch to the prompt, how come I can't access any of my namespaces from the lein repl prompt?

alexwheeler17:04:20

(just trying to wrap my head around how these are all playing together)

dominicm17:04:29

I think you've created two separate repl environments there, and connected to them separately.

alexwheeler17:04:24

@dominicm yes that's what it sounds like, the trouble I'm having is that I'm making ajax requests, it doesn't sound like I'll see that response in vim when it resolves right?

alexwheeler17:04:36

just the result of the function that makes the request that I evaluate with cpp

dominicm17:04:15

Uh, not if it's async

dominicm17:04:25

Fireplace doesn't persistently listen