neovim-ctrl

Crates.ioneovim-ctrl
lib.rsneovim-ctrl
version0.2.1
sourcesrc
created_at2019-02-07 04:15:28.759136
updated_at2024-10-06 15:34:29.374899
descriptionA program to find and interact with a Neovim instance running in a particular terminal.
homepagehttps://github.com/d-e-s-o/neovim-ctrl
repositoryhttps://github.com/d-e-s-o/neovim-ctrl.git
max_upload_size
id113282
size68,636
Daniel Müller (d-e-s-o)

documentation

README

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
Commit count: 58

cargo fmt