vim

For discussion on all things (neo)vim.
2020-06-29T08:21:21.249Z

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?

2020-07-01T07:21:32.340700Z

@noisesmith 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

2020-07-01T15:39:25.341Z

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 https://github.com/kassio/neoterm - I use this to send parts of a file over to a repl client (just make sure the namespaces match)

2020-07-01T15:39:44.341300Z

but maybe the tmux integration is the same / better

2020-06-29T09:30:53.249600Z

@bendy i don't know the answer to your question, but @liquidz.uo might

dominicm 2020-06-29T12:47:04.249800Z

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

dominicm 2020-06-29T12:47:28.250Z

I'm not sure exactly what your setup is

2020-06-29T13:23:35.250200Z

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

2020-06-29T14:59:20.250400Z

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

2020-06-29T15:00:24.250700Z

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

2020-06-29T15:01:26.250900Z

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