Skip to content

Instantly share code, notes, and snippets.

@ferdinandkeller
Last active December 8, 2023 09:27
Show Gist options
  • Save ferdinandkeller/14f54c2ff3d8837c6801bb1cbf340d00 to your computer and use it in GitHub Desktop.
Save ferdinandkeller/14f54c2ff3d8837c6801bb1cbf340d00 to your computer and use it in GitHub Desktop.
#!/bin/bash
# rhel-only stuff
function rhel_setup () {
# we install EPEL and CRB
sudo dnf install -y epel-release
sudo dnf config-manager --set-enabled crb
# we install the packages needed to build the latest nvim version (for ubuntu)
sudo dnf -y install ninja-build cmake gcc make unzip gettext curl
# continue with instructions common to both distros
global_install
}
# debian only stuff
function debian_setup () {
# we install the packages needed to build the latest nvim version (for ubuntu)
sudo apt update
sudo apt install -y ninja-build gettext cmake unzip curl git
# continue with instructions common to both distros
global_install
}
# actual installayion
function global_install () {
# we clone the nvim repo
git clone https://github.com/neovim/neovim.git
# we move to the repo, and select the stable branch
cd ./neovim
git checkout stable
# build and install the editor
make CMAKE_BUILD_TYPE=Release
sudo make install
# once done, we remove the repository
cd ..
rm -rf ./neovim
# clone the nvchad configuration
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
}
# install on rhel-like distros
if [ -f /etc/redhat-release ]; then
rhel_setup
# install on debian-like distros
elif [ -f /etc/lsb-release ]; then
debian_setup
else
echo "your distro doesn't seem to be supported yet"
fi
@ferdinandkeller
Copy link
Author

ferdinandkeller commented Dec 8, 2023

Install script (needs sudo, curl and bash preinstalled):

curl --proto '=https' --tlsv1.2 -sSfL https://gist.githubusercontent.com/ferdinandkeller/14f54c2ff3d8837c6801bb1cbf340d00/raw | bash

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