Note that the Gemini CLI wrote the following after getting me all set up, any errors are not my own. The motivation was getting LunarVim to run without nvim-related errors; my nvim was too new (0.11.something) and there were no pre-built packages for downgrading.
This guide provides instructions for compiling and installing Neovim 0.9.5 from source on Termux, including the necessary dependencies and manual installation steps.
First, install the required build tools and libraries using the pkg package manager:
pkg install -y cmake ninja gettext libtool unzip curl lua51 luarocks libtermkeyNext, use luarocks to install the required Lua libraries:
luarocks install mpack
luarocks install luabitopNow, download the Neovim source code, compile it, and manually install it.
# Create a temporary directory for the build
mkdir -p ~/nvim_build_temp
cd ~/nvim_build_temp
# Download and extract the source code
curl -LO https://github.com/neovim/neovim/archive/refs/tags/v0.9.5.tar.gz
tar xzf v0.9.5.tar.gz
cd neovim-0.9.5
# Configure the build with cmake
# The CMAKE_POLICY_VERSION_MINIMUM flag is needed for compatibility
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5
# Compile the source code
# This will build the nvim executable in the build/bin/ directory
# Note: The build may appear to fail on translation files, but the main executable will be ready.
make -C build
# Manually install the executable and runtime files
cp build/bin/nvim $PREFIX/bin/
mkdir -p $PREFIX/share/nvim/runtime
cp -r runtime/* $PREFIX/share/nvim/runtime/
# Clean up the temporary build files
rm -rf ~/nvim_build_tempFinally, verify that Neovim is installed correctly:
nvim --versionYou should see the output NVIM v0.9.5.