Open newptcai opened 1 year ago
Hi @newptcai
I don't use kitty myself, so I don't know if this changed. 🤔
Would you be willing to open a documentation PR for this?
cc @mdzhang @xiangpeng2008
can confirm i can use vim + kitty + slime w/o listen_on unix:/tmp/mykitty
kitty 0.26.3 macos 12.6 monterey vim 9.0.0700
can confirm i can use vim + kitty + slime w/o
listen_on unix:/tmp/mykitty
kitty 0.26.3 macos 12.6 monterey vim 9.0.0700
If you run kitty and vim in the same os_window,
then the environment variable KITTY_LISTEN_ON
will be set correctly.
You just need to provide the correct window ID.
Hi there,
This has been opened for a few weeks ^
Can someone open a PR with their recommended/udpated kitty config?
I think I explained things reasonably clear in Readme in my PR.
The ReadMe says
To work properly, kitty must also be started with the following options:
kitty -o allow_remote_control=yes --listen-on unix:/tmp/mykitty
See more here. This can also be added to your kitty.conf file as:
allow_remote_control yes listen_on unix:/tmp/mykitty
This is inaccurate. Putting
listen_on unix:/tmp/mykitty
will make each kitty instance listen tounix:/tmp/mykitty{kitty_pid}
, where{kitty_pid}
is the PID of the kitty process.So to make slime work, you have to launch kitty from command line, or to use the method.
You can actually make it work quite easily with a few lines in your .vimrc/init.lua. I currently have the following lines in my init.lua file that assigns the correct default value for vim-slime by extracting the pid of kitty process. However, this breaks if one has multiple kitty instances running at the same time.
-- NOTE: Assumes that kitty.conf has parameter
-- 'listen_on' set to unix:/tmp/mykitty
-- In this case, kitty will append the pid of kitty to the end of the path
-- Thus we check the pid of the kitty instance, and use that as the
--
local pid = vim.fn.system("pgrep kitty")
pid = pid:gsub("[\n\r]","")
local listen_on = string.format("unix:/tmp/mykitty-%s", pid)
vim.g.slime_default_config = {['listen_on']=listen_on, ['window_id']=2}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The ReadMe says
This is inaccurate. Putting
listen_on unix:/tmp/mykitty
will make each kitty instance listen tounix:/tmp/mykitty{kitty_pid}
, where{kitty_pid}
is the PID of the kitty process.So to make slime work, you have to launch kitty from command line, or to use the method.