vimr
                                
                                 vimr copied to clipboard
                                
                                    vimr copied to clipboard
                            
                            
                            
                        [FEAT] Provide a GUI or file to configure environment-variables for the spawned neovim process
In particular, I don't launch VimR from an existing terminal, so vimr --cur-env is useless to me — I'm a "terminal inside VimR", not "VimR from a terminal" kinda user!
I'd like to use nvr, from neovim-remote, as my $GIT_EDITOR and the like. I've configured my $NVIM_LISTEN_ADDRESS to /tmp/nvimsocket using shell configuration files; and that works fine, of course … if I launch VimR from a terminal:
- Open a macOS Terminal.app
- Use vimr --cur-env, so VimR's neovim inherits the shell$NVIM_LISTEN_ADDRESS
- Open another :terminalinside VimR itself
- Proceed normally with Git operations and suchlike, with nvrinstructing VimR to open windows/buffers/etc as appropriate.
- nvrtalks to VimR's embedded Neovim over- /tmp/nvimsocket; all works fine!
However, in a more normal form of usage,
- Open VimR from the Finder
- Open :terminalinside VimR itself
- Proceed normally with Git operations and suchlike, with nvrinstructing VimR to open windows/buffers/etc as appropriate.
- nvrtries to communicate to- /tmp/nvimsocket; but VimR's neovim is listening on something random like:
 ... so nothing happens.- /var/folders/qx/mxf_tg093sn9xzthq9p9trfm0000gn/T/vimr_9F9C9D7A-71EA-4414-94DB-D8677C1C6E06.sock
This is, however, just a specific case of the "we don't have control over the integrated neovim instance" issue. I really do think that the ideal solution to this is to simple make it configurable.
This isn't the first time this sort of issue has cropped up; and plenty of other GUI editors that invoke tools and similar offer options like this. I really hope you'll consider such a feature worth your time!
If you just need it inside the embedded neovim terminal, maybe you could try to set the correct servername in your configuration ?
let $NVIM_LISTEN_ADDRESS=v:servername
Unfortunately, that's the inverse — I need to configure the embedded neovim itself, not the terminal.
Edit: Oh, I mis-understood you — you mean configuring the embedded terminal, so launched-inside-VimR applications work as expected.
That's actually a really helpful tip, although it doesn't solve the underlying problem — with that solution, for instance, if I open a external Terminal.app window after launching VimR from the GUI, it won't be able to control my VimR instance.
For anybody else coming across this, the actual line @Andilutten suggested ended up being unnecessary — I'd hardcoded the envvar in my .profile, and thus it was getting overwritten on :terminal-start; all I had to do to at least get nvr instances inside VimR to start working was the following:
+|if [ -z "$NVIM_LISTEN_ADDRESS" ]; then
 |   export NVIM_LISTEN_ADDRESS="/tmp/nvimsocket"
+|fi
I asked for something similar (to configure the socket) here: https://github.com/qvacua/vimr/issues/797
This would be excellent, as currently with certain neovim configs, you need to set env variables for core functionality. E.g. I'm attempting to run Python code for the minted LaTeX package in SpaceVim, but SpaceVim requires an environment variable to be set to have Python functionality.