From 4fa2c74fca9e9599df8aabc913996e1513e1d178 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sun, 10 May 2026 04:15:25 -0400 Subject: [PATCH] auto-add nvim to .bashrc_paths after install Co-Authored-By: Claude Sonnet 4.6 --- install_neovim.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/install_neovim.sh b/install_neovim.sh index a9076f2..7a0480a 100755 --- a/install_neovim.sh +++ b/install_neovim.sh @@ -10,6 +10,7 @@ echo " - apt-get update (if curl not installed)" echo " - apt-get install -y curl (if needed)" echo " - rm -rf /opt/nvim-linux64 or /opt/nvim-linux-x86_64 (if old installation exists)" echo " - tar -C /opt -xzf nvim-linux-x86_64.tar.gz" +echo " - add nvim to PATH in ~/setup_env/dotfiles/.bashrc_paths (if not already there)" echo "" read -p "Continue with installation? (y/N) " -n 1 -r echo @@ -73,8 +74,17 @@ if [ -x /opt/nvim-linux-x86_64/bin/nvim ]; then /opt/nvim-linux-x86_64/bin/nvim --version | head -n1 echo "" echo "Neovim is installed at: /opt/nvim-linux-x86_64/bin/nvim" - echo "Add to PATH by adding this to your ~/.bashrc:" - echo ' export PATH="$PATH:/opt/nvim-linux-x86_64/bin"' + + # Add to .bashrc_paths if not already there + BASHRC_PATHS="$HOME/setup_env/dotfiles/.bashrc_paths" + NVIM_PATH_LINE='[ -d /opt/nvim-linux-x86_64/bin ] && export PATH="/opt/nvim-linux-x86_64/bin:$PATH"' + if [ -f "$BASHRC_PATHS" ] && ! grep -qF "nvim-linux-x86_64" "$BASHRC_PATHS"; then + echo "" >> "$BASHRC_PATHS" + echo "# Neovim (installed by install_neovim.sh)" >> "$BASHRC_PATHS" + echo "$NVIM_PATH_LINE" >> "$BASHRC_PATHS" + echo "Added nvim to PATH in $BASHRC_PATHS" + echo "Run 'source ~/.bashrc' to apply." + fi else echo "Error: Neovim installation failed" >&2 exit 1