Skip to content

Instantly share code, notes, and snippets.

@darcyparker
Last active June 26, 2025 05:50
Show Gist options
  • Save darcyparker/153124662b05c679c417 to your computer and use it in GitHub Desktop.
Save darcyparker/153124662b05c679c417 to your computer and use it in GitHub Desktop.
Build and install neovim for Debian
#!/usr/bin/env bash
#Build and install neovim for Debian
#See: https://neovim.io/
#See: https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start
#See: https://gist.github.com/darcyparker/153124662b05c679c417
#Save current dir
pushd . >/dev/null || exit
#Install dependencies
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
cmake \
g++ \
gettext \
libncurses5-dev \
libtool \
libtool-bin \
libunibilium-dev \
libunibilium4 \
lua5.1 \
lua5.4 \
luarocks \
liblua5.1-0-dev \
ninja-build \
pkg-config \
python3-pip \
software-properties-common \
unzip
# Enable use of python plugins
# Note: python neovim module was renamed to pynvim
VENV_DIR="$HOME/.config/nvim/pynvim-venv"
if [ ! -d "$VENV_DIR" ]; then
python3 -m venv "$VENV_DIR" &>/dev/null
fi
# "$VENV_DIR/bin/pip" install --upgrade setuptools
"$VENV_DIR/bin/pip" install --upgrade pynvim
# In nvim/lua configs:
# -- Define the path to your Neovim virtual environment's bin directory
# local venv_bin_path = vim.fn.expand("~/.config/nvim/pynvim-venv/bin")
#
# -- Prepend the venv bin directory to Neovim's PATH environment variable.
# -- This allows Neovim and its plugins to find executables like 'ueberzugpp'.
# vim.env.PATH = venv_bin_path .. ":" .. vim.env.PATH
#
# vim.g.python3_host_prog = venv_bin_path .. "/python"
unset VENV_DIR
gem install neovim
npm install -g neovim
#Get or update neovim github repo
mkdir -p ~/src
cd ~/src || exit
if [ ! -e ~/src/neovim ]; then
git clone https://github.com/neovim/neovim
else
cd neovim || exit
git pull origin
fi
cd ~/src/neovim || exit
git checkout master
#Remove old build dir and .deps dir
rm -rf build/
rm -rf .deps/
make distclean
# Build and install neovim
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr/local/"
make install
# Enable use of ruby plugins
# sudo gem install neovim
#Restore dir
popd >/dev/null || exit
echo "nvim command: $(command -v nvim)"
echo "nvim command: $(ls -al "$(command -v nvim)")"
@bestouff
Copy link

Just a big thank you @osamuaoki !

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