1

Add a script for installing neovim from source

This commit is contained in:
Evan Pratten 2023-10-28 13:49:34 -04:00
parent 779c5bb99f
commit 000d33b961
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,39 @@
#! /bin/bash
set -e
echo "You have chosen to isntall neovim from source."
# If ~/src/neovim doesn't exist, clone a fresh copy
cd ~/src
if [ ! -d ~/src/neovim ]; then
git clone https://github.com/neovim/neovim
fi
cd neovim
# Handle branch checkout
echo "Do you want to switch to the stable branch? (y/n)"
read -r -n 1 response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
git checkout stable
fi
# Figure out the appropriate make command.
if [ -x "$(command -v gmake)" ]; then
MAKE_CMD=gmake
else
MAKE_CMD=make
fi
# Determine the install prefix
NVIM_INSTALL_PREFIX=${NVIM_INSTALL_PREFIX:-$HOME/.local}
# Build
echo "Building neovim..."
$MAKE_CMD CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$NVIM_INSTALL_PREFIX"
# Install
echo "Would you like to install neovim? (y/n)"
read -r -n 1 response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
$MAKE_CMD install
fi

View File

@ -19,6 +19,7 @@ alias sheridan-rdp='firefox --new-window "ext+container:name=College&url=https:/
alias git-diff-nvim="git diff | nvim -R -d -c 'set filetype=diff' -" alias git-diff-nvim="git diff | nvim -R -d -c 'set filetype=diff' -"
alias yk-totp="ykman oath accounts code" alias yk-totp="ykman oath accounts code"
alias flush-dns-cache="sudo systemd-resolve --flush-caches" alias flush-dns-cache="sudo systemd-resolve --flush-caches"
alias which-ls="ls -la $(which ls)"
# WHOIS macros # WHOIS macros
alias whois-afrinic="whois -h whois.afrinic.net" alias whois-afrinic="whois -h whois.afrinic.net"