Skip to content

Instantly share code, notes, and snippets.

@ashemedai
Last active May 8, 2024 12:32
Show Gist options
  • Save ashemedai/21a4e34b71cfadb28326b7406a15c601 to your computer and use it in GitHub Desktop.
Save ashemedai/21a4e34b71cfadb28326b7406a15c601 to your computer and use it in GitHub Desktop.
neovim fetch and install script
#!/bin/sh
if [ -z "${1}" ]; then
echo "Enter nvim release number"
read VERSION
else
VERSION=${1}
fi
ARCHIVE="nvim-linux64.tar.gz"
URL="https://github.com/neovim/neovim/releases/download/v${VERSION}/${ARCHIVE}"
INSTALL_HOME="${HOME}/.local"
RUNTIME_DIR="share/nvim/runtime"
fetch () {
echo "Fetching nvim archive from '${URL}'"
curl -sSLO "${URL}"
}
extract () {
echo "Removing runtime directory at '${INSTALL_HOME}/${RUNTIME_DIR}'"
rm -rfI "${INSTALL_HOME}/${RUNTIME_DIR}"
tar -x -f "${ARCHIVE}" -C "${INSTALL_HOME}" -v -z --strip-components=1
}
fetch
extract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment