tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.74k stars 139 forks source link

Jack in #363

Open tpope opened 5 years ago

tpope commented 5 years ago

Jobs make firing off lein repl :headless or a similar command in the background a much less dicey prospect than when Fireplace was introduced. Evaluate adding the option to start a REPL in the background.

SevereOverfl0w commented 5 years ago

https://github.com/clojure-vim/vim-jack-in might serve as inspiration

Feedback that I received on the initial vim-jack-in, people don't like it when closing their editor closes the REPL.

benknoble commented 3 years ago

I would be willing to try to work on this—is there any particularly good launching point? Or should I just look for where the commands are run and wrap them in an "if jobs, do that, otherwise do the original synchronous thing"?

benknoble commented 3 years ago

I need to reword that. Perhaps it would be simpler to simply write a ConnectBg or similar command that tries to launch the right repl in the background, and then runs FireplaceConnect as a callback.

tpope commented 3 years ago

I think a separate command is probably the way to go. Calling FireplaceConnect in a callback might not be necessary if .nrepl-port or similar is created.

benknoble commented 3 years ago

Calling FireplaceConnect in a callback might not be necessary if .nrepl-port or similar is created.

Can I take this to mean that fireplace detects the creation of .nrepl-port and automatically connects? Or is it more like when a connection is needed, one is automatically created from .nrepl-port if it exists?

Another Q: does fireplace already have standard code for detecting lein vs. clojure-CLI (are there any others?), or would I need to write that/rip that from salve/classpath/etc.?

tpope commented 3 years ago

Calling FireplaceConnect in a callback might not be necessary if .nrepl-port or similar is created.

Can I take this to mean that fireplace detects the creation of .nrepl-port and automatically connects? Or is it more like when a connection is needed, one is automatically created from .nrepl-port if it exists?

Automatically created on demand.

Another Q: does fireplace already have standard code for detecting lein vs. clojure-CLI (are there any others?), or would I need to write that/rip that from salve/classpath/etc.?

Nothing exists for this in Fireplace. In fact I am undecided on whether this feature should live inside of Fireplace or outside of it for that reason.