Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kenakofer/6e1d93517d27e8d754024d6141691c86 to your computer and use it in GitHub Desktop.

Select an option

Save kenakofer/6e1d93517d27e8d754024d6141691c86 to your computer and use it in GitHub Desktop.
Process for building/installing Neovim 0.9.5 on Termux

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.

Installing Neovim 0.9.5 on Termux

This guide provides instructions for compiling and installing Neovim 0.9.5 from source on Termux, including the necessary dependencies and manual installation steps.

1. Install Dependencies

First, install the required build tools and libraries using the pkg package manager:

pkg install -y cmake ninja gettext libtool unzip curl lua51 luarocks libtermkey

Next, use luarocks to install the required Lua libraries:

luarocks install mpack
luarocks install luabitop

2. Download and Compile

Now, 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_temp

3. Verify Installation

Finally, verify that Neovim is installed correctly:

nvim --version

You should see the output NVIM v0.9.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment