Files
shell/install/nvim
2025-05-21 20:26:23 +08:00

34 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
##makedesc: Install nvim + lazyvim
source "$( dirname $(readlink -e -- "${BASH_SOURCE}"))/../helpers.sh" || exit 255
# https://www.lazyvim.org/installation
# https://www.devas.life/effective-neovim-setup-for-web-development-towards-2024/
title
require git
nvimUrl="https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz"
installPath="$HOME/install"
installTar="$installPath/nvim.tar.gz"
[ -d "$HOME/.config/nvim" ] && mv "$HOME"/.config/nvim{,.bak}
[ -d "$HOME/.local/share/nvim" ] && mv "$HOME"/.local/share/nvim{,.bak}
[ -d "$HOME/.local/state/nvim" ] && mv "$HOME"/.local/state/nvim{,.bak}
[ -d "$HOME/.cache/nvim" ] && mv "$HOME"/.cache/nvim{,.bak}
download "$nvimUrl" "$installTar"
unpack_targz "$installTar" "$installPath"
sudo rm -vrf /opt/nvim
sudo mv -v "$installPath/nvim-linux-x86_64" /opt/nvim
git.clone_quick https://github.com/LazyVim/starter "$HOME/.config/nvim"
rm -rf "$HOME/.config/nvim/.git"
sudo update-desktop-database && \
xdg-desktop-menu forceupdate
# export PATH="$PATH:/opt/nvim-linux-x86_64/bin"