From 10963c848b6bcb974aea5354a7fbfcd89d5811c6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 18:27:10 +0000 Subject: [PATCH] Fix Neovim not found after install by symlinking /usr/local/bin/nvim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The PATH line written to /etc/profile.d/neovim.sh was only sourced by login shells via /etc/profile. zsh — set as the default shell by this script — uses /etc/zsh/zprofile which sources /etc/profile only for login shells, and terminal emulators typically launch non-login interactive shells. The result on Debian 13 ARM64 (and other distros): nvim installed correctly to /opt/nvim-linux-arm64 but was not on PATH in a normal terminal session. Symlink the binary into /usr/local/bin/nvim instead — that directory is always on the default PATH on Linux and macOS (Apple Silicon and Intel) regardless of shell type. The Zig install already follows this pattern. Also switch the install-detection probe to the symlink so it verifies an actually-callable nvim, not just the extracted directory. https://claude.ai/code/session_01VP9hCLH1c5F5iv468jSkqs --- bootstrap_environment.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bootstrap_environment.py b/bootstrap_environment.py index bf024eb..9d04d18 100755 --- a/bootstrap_environment.py +++ b/bootstrap_environment.py @@ -1005,7 +1005,7 @@ _DEFAULT_INSTALL_PATHS: dict[str, Path] = { "zig": Path("/usr/local/bin/zig"), "nvm": Path("~/.nvm"), "pyenv": Path("~/.pyenv"), - "neovim": Path(f"/opt/nvim-{_OS_NVIM[OS]}-{_ARCH_NVIM[ARCH]}"), + "neovim": Path("/usr/local/bin/nvim"), "oh-my-zsh": Path("~/.oh-my-zsh"), } @@ -1273,8 +1273,14 @@ def _install_neovim(pkg: CustomPackage, tmp: Path) -> None: run(["rm", "-rf", install_dir], as_sudo=True) run(["tar", "-C", "/opt", "-xzf", str(dest)], as_sudo=True) - _append_profile_line("neovim", f'export PATH="$PATH:{install_dir}/bin"') - print(f" Neovim installed to {install_dir}") + # Symlink into /usr/local/bin so `nvim` is on PATH for every shell type + # (login, interactive, scripts) without relying on /etc/profile.d, which + # is only sourced by login shells — terminal emulators typically launch + # non-login interactive shells. + run(["mkdir", "-p", "/usr/local/bin"], as_sudo=True, check=False) + symlink = "/usr/local/bin/nvim" + run(["ln", "-sf", f"{install_dir}/bin/nvim", symlink], as_sudo=True) + print(f" Neovim installed to {install_dir}, symlinked at {symlink}") def _clone_nvim_config() -> None: -- 2.47.3