jpalardy / vim-slime

A vim plugin to give you some slime. (Emacs)
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/
MIT License
1.83k stars 223 forks source link

kitty: get listen_on from environment if available #401

Closed ptonner closed 8 months ago

ptonner commented 8 months ago

This checks for KITTY_LISTEN_ON as an environment variable and uses if set, which the docs say is already done. But the code doesn't actually seem to read the environment variable. Also not sure why the docs suggests this will only work in vim, this works fine in nvim

This is also my first lines of vim script ever, so make sure I haven't done anything too stupid - namely I hope the check for empty string is all that's needed when setting listen_on

jpalardy commented 8 months ago

Hi @ptonner

Thanks for the PR :tada:

I'm not a kitty user myself, nor have I written the original code. So, it's possible that either the code and/or the docs are in the best possible state.

It would seem to me that if line 4 was changed to:

let b:slime_config = {"window_id": 1, "listen_on": $KITTY_LISTEN_ON}

and nothing else was changed ... it would accomplish what's needed.

I don't know if you can weigh in, one way or another. We can iterate base on what you find.

I'm also reading this: https://sw.kovidgoyal.net/kitty/remote-control/#cmdoption-kitty-to -- so, it seems like vim-slime can delegate to kitty, without having to deal with KITTY_LISTEN_ON itself ... which was probably the original intent :thinking:

jpalardy commented 8 months ago

It's looking good ^

If you're happy with this, I can merge this.

ptonner commented 8 months ago

sure! I was just testing it out at work for the day, seems good to me

jpalardy commented 8 months ago

Thanks again for the PR 👍