I want to open new files from the command line on Windows in a single nvim-qt instance that is already open.
I know the existence of the --server
option, but how do I know the IP or the socket name or path of the running instance?
As el_technic0 said, the neovim-remote utility is the easiest way to get remote file opening to work. I even added an alias
to it in my .bashrc
file (alongside the listen address definition) for easier invocation:
export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket
alias vim='nvr --remote'
This way the first call will start a new neovim instance, and subsequent calls will be forwarded to that instance.
You may also want to add the set hidden
option to your init.vim
configuration file, otherwise subsequent calls may fail if the current buffer contains unsaved changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With