neovim-ctrl is a program to find and interact with a Neovim instance running in a particular terminal.
The program supports two commands:
- find-socket
to discover the Unix domain socket of a running Neovim
- change-window
to change the currently selected window/split based on
a key sequence
The program requires the TTY for which to find the (first) running Neovim process the first argument.
```bash
$ nvim-ctrl find-socket /dev/pts/3
/tmp/nvimfMfu99/0 ```
```bash
$ ctrlw=$(echo -n -e "\x17") $ nvim-ctrl change-window /dev/pts/7 "${ctrlw}h"
$ echo $?
0
$ nvim-ctrl change-window /dev/pts/7 "${ctrlw}h"
Error: nothing changed
Exit code 1 means that no change happened.
$ echo $?
1 ```