dgrnbrg / vim-redl

A better Vim integration story for Clojure
106 stars 8 forks source link

Add ability to eval for under cursor in the redl #13

Open qiuwei opened 11 years ago

qiuwei commented 11 years ago

How can I evaluate a form under cursor in the debug repl?

It seems :Replhere would create a debug repl automatically. But how can I send forms to it like "cpp" in vim-fireplace?

Thanks!

mascip commented 10 years ago

I'm a very new user, but as far as I've seen, it's not possible. You either use vim-fireplace's "cpp" to execute in the code's buffer, or you copy your code (with "yab" for example, to copy the current block), change buffer, paste it in the REPL, and execute.

But I agree that it would be a nice feature. I have no idea what it involves in terms of implementation, though.

dgrnbrg commented 10 years ago

I have changed the target of this issue. There's 2 ways that this could be done: either we could make Redl first-class nrepl middleware, in which case cpp would directly connect to it, or we could add a new command, like "crp", that would send the form under the cursor to the redl. The tricky part here is choosing which redl to send it to--I don't think that's a simple problem, since I think it's very hard to determine which ones are currently opened.

mascip commented 10 years ago

The first solution sounds very good, but how much work does it represent for you? Would there be other benefits from this approach?

dgrnbrg commented 10 years ago

The first solution would require me to learn how nrepl works--last I looked, it seemed pretty confusing & specific to emacs. Perhaps the docs are better now.