#neovim #tmux #unix-domain-socket #procfs #linux #proc

app neovim-ctrl

A program to find and interact with a Neovim instance running in a particular terminal

3 unstable releases

0.2.0 Jan 20, 2024
0.1.1 May 26, 2020
0.1.0 Feb 7, 2019

#108 in Unix APIs

Download history 2/week @ 2024-01-17 2/week @ 2024-02-14 17/week @ 2024-02-21 17/week @ 2024-02-28 1/week @ 2024-03-13 20/week @ 2024-03-27 35/week @ 2024-04-03

55 downloads per month

GPL-3.0-or-later

24KB
553 lines

pipeline crates.io rustc

neovim-ctrl

neovim-ctrl is a program to find and interact with a Neovim instance running in a particular terminal. It works with Neovim 0.9.0 and higher.

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

Usage

The program requires the TTY for which to find the (first) running Neovim process the first argument.

# Find the path to the Unix domain socket for a nvim process on TTY
# /dev/pts/3:
$ nvim-ctrl find-socket /dev/pts/3
> /tmp/nvimfMfu99/0
# Send Ctrl-w-h to the Neovim on /dev/pts/7:
$ ctrlw=$(echo -n -e "\\x17")
$ nvim-ctrl change-window /dev/pts/7 "${ctrlw}h"
# Exit code 0 indicates that the window was actually changed.
$ echo $?
> 0

$ nvim-ctrl change-window /dev/pts/7 "${ctrlw}h"
> Error: nothing changed
# Exit code 1 means that no change happened.
$ echo $?
> 1

Dependencies

~0.8–1.2MB
~24K SLoC