neovim-remote icon indicating copy to clipboard operation
neovim-remote copied to clipboard

Send a command to all nvim istances

Open Spo0on opened this issue 1 year ago • 0 comments

I would like to be able to simultaneously send a command to each open nvim instance under a same dir. E.g. when i open nvim it spawns an instance within a folder under /var/folders/8d/l1qvyhds0c57j9shgl2412_00000gn/T/nvim.(my username)/. So what i want to do is to send the command nvr --nostart --remote-send ':set background=light<CR>' (or :set background dark) to all nvim istances under these dirs to change nvim appearance in all windows simultaneously. I managed to solve by using a small script:

for file in /var/folders/8d/l1qvyhds0c57j9shgl2412_00000gn/T/nvim.giuliocorona/*/*
do
    /Library/Frameworks/Python.framework/Versions/3.11/bin/nvr --nostart --remote-send ':set background=dark<CR>' --servername "$file"
done

but would be easier having a dedicated option.

Spo0on avatar Apr 08 '23 11:04 Spo0on