I'm using neovim-remote
/nvr
to avoid nested instances of nvim when using the integrated terminal. This is the code:
# config.fishif set -q NVIM # Avoid nested neovim instances with neovim-remote set -gx EDITOR "nvr --remote-wait" alias nvim nvrelse set -gx EDITOR nvimendset -gx VISUAL $EDITOR
It works well. A pain point is temporary files; it's why I use --remote-wait
. If I don't, the program that is expecting to read the temporary file (e.g. git commits, Alt-E
to edit fish's command line in $EDITOR
) breaks.
This works, but I know neovim has a built-in --remote
feature, and I'd like to use that to avoid the dependency. This is the configuration:
# config.fishif set -q NVIM # Avoid nested neovim instances with nvim --remote set -gx EDITOR "nvim --server $NVIM --remote" alias nvim $EDITORelse set -gx EDITOR nvimendset -gx VISUAL $EDITOR
However, this doesn't work with temporary files. For example, git complains that the message was empty and aborts the commit. Fish doesn't modify the prompt. From what I can gather, the difference is that nvr --remote-wait
blocks until all buffers are deleted but nvim --remote
doesn't.