From 588ca6e31077e3b7e691a57a948e77909d2efa18 Mon Sep 17 00:00:00 2001 From: Ersin Akinci Date: Fri, 21 Feb 2020 18:01:37 +0000 Subject: neovim: use TMPDIR as home during initilizaiton --- pkgs/applications/editors/neovim/wrapper.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkgs/applications/editors/neovim') diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index c0b976677579..c7d5f7649783 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -95,6 +95,16 @@ let '' + optionalString (configure != {}) '' echo "Generating remote plugin manifest" export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim + # Some plugins assume that the home directory is accessible for + # initializing caches, temporary files, etc. Even if the plugin isn't + # actively used, it may throw an error as soon as Neovim is launched + # (e.g., inside an autoload script), causing manifest generation to + # fail. Therefore, let's create a fake home directory before generating + # the manifest, just to satisfy the needs of these plugins. + # + # See https://github.com/Yggdroot/LeaderF/blob/v1.21/autoload/lfMru.vim#L10 + # for an example of this behavior. + export HOME="$(mktemp -d)" # Launch neovim with a vimrc file containing only the generated plugin # code. Pass various flags to disable temp file generation # (swap/viminfo) and redirect errors to stderr. -- cgit 1.4.1