Kitty: Kitty remote control from neovim

Created on 23 Dec 2018  路  4Comments  路  Source: kovidgoyal/kitty

Trying to call kitty @ new-window from neovim, but running into some issues.

I believe it's related to this issue, because it works fine with vim.

:!kitty @ new-window from neovim outputs the following:

:!kitty @ new-window
Traceback (most recent call last):
  File "Python/runpy.py", line 280, in run_path
  File "Python/runpy.py", line 85, in _run_code
  File "kitty/__main__.py", line 117, in <module>
  File "kitty/__main__.py", line 113, in main
  File "kitty/__main__.py", line 22, in remote_control
  File "kitty/remote_control.py", line 176, in main
  File "kitty/remote_control.py", line 120, in do_io
  File "kitty/utils.py", line 376, in __enter__
OSError: [Errno 6] Device not configured

shell returned 1

Press ENTER or type command to continue

:!kitty "@ new-window" outputs:

:!kitty "@ new-window"
 new-window is not a known command. Known commands are: close-tab, close-window, focus-tab, focus-window, get-colors, get-text, goto-layout, kitten, last-used-layout, ls, new-wi
ndow, resize-window, send-text, set-background-opacity, set-colors, set-font-size, set-tab-title, set-window-title

shell returned 1

Press ENTER or type command to continue

and :call system("kitty @ new-window") just doesn't do anything.

Most helpful comment

I ended up writing this vim plugin: vim-kitty-navigator. Maybe someone will find it useful.

All 4 comments

kitty @ works via a tty device by default. If you have no tty device, which I assume is the case with neovim, you will need to setup a dedicated socket for it. See the --help of the --to option for kitty @ and the --listen option for kitty.

Thanks @kovidgoyal that works. This might be a silly question, but; how can I run kitty with options without keeping a second terminal open? Right now I'm running kitty --some-options from... kitty, which launches another instance of kitty, and if I close the first one, it closes the second one as well.

create an alias or a launch script or if you are on macOS use the cmdline facility described in the kitty FAQ

I ended up writing this vim plugin: vim-kitty-navigator. Maybe someone will find it useful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nudin picture Nudin  路  3Comments

metalelf0 picture metalelf0  路  4Comments

bewzaalex picture bewzaalex  路  3Comments

reed-jones picture reed-jones  路  4Comments

crocket picture crocket  路  4Comments