Fork me on GitHub

Hey all - I was working on my dev env with vim-iced and tmux. When I was working on it, I would fire up vim in one tmux pane, and open the repl with iced repl in another tmux pane. Evaluating the buffer (`\eb`) or any code would cause it to evaluate in the repl session in the right hand side, which is the behavoir I want. Now when I open the same setup, code within vim is executed but it does not effect the state of the repl in the second tmux pane. Is this intended/how the nREPL connections should work? Is there a way around this that anyone knows?


@U0M0R1LUC i don't know the answer to your question, but @UBL24PLE6 might


@U0M0R1LUC it depends if you've started another JVM or not.


I'm not sure exactly what your setup is


So after a lot of tinkering I've found that if I connect via vim-iced prior to connecting to a repl with iced repl, then the context is shared between the two sessions. For now it's working though, although if anyone has some documentation/references about how nRPEL contexts work, I'd be very intruiged


I'm not sure what you're uncertain about here. To be clear (and risking telling you things you already know): • a single jvm clojure only has one global state for namespaces • a single namespace has one global state for vars if your changes in one repl aren't reflected in the other, this is because the repls are talking to two different vms


nREPL contexts are instances of nrepl client objects, each one is dedicated to a specific remote vm


if you want an editor and terminal repl to be connected to the same vm, the simplest thing is to start the repl (with server) in the terminal, and connect (and not start a new vm) with the client


@U051SS2EU that actually clears things up a lot, thanks. I wasn't aware that there was a single global state for namespaces, but that makes it much easier to ration about. I'm not sure how my repls were connecting but clearly the order of operations was spinning up multiple vms


one more thing: if you are using neovim/nvim the neoterm package lets you define a shortcut to send a region to a terminal in the editor - I use this to send parts of a file over to a repl client (just make sure the namespaces match)


but maybe the tmux integration is the same / better