neovim-config/install/install_nvim.sh

43 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
installdir="$HOME/.local/bin"
applications_dir="$HOME/.local/share/applications"
icon_dir="$HOME/.local/share/icons"
orig_dir=$( pwd )
echo "install directory is $installdir"
if [ ! -d $installdir ]; then
echo "install directory does not exist, creating it"
mkdir -p $installdir || (echo "failed to create install directory" ; exit 1)
fi
cd $installdir
echo "downloading appimage..."
wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage || (echo "failed to download appimage"; exit 1)
echo "done."
chmod +x nvim.appimage
echo "Setting up nvim for GNOME."
echo "This part is optional since it might fail."
cd $orig_dir
echo "copying icon..."
cp nvim.svg $icon_dir
echo "copying .desktop..."
cp nvim.desktop $applications_dir
echo "You might have to update $applications_dir/nvim.desktop."
echo "Probably because your user name is different."
echo "Also you should set nvim as the handler for all the mimetypes:"
echo " xdg-mime default nvim.desktop text/english text/plain text/x-makefile text/x-c++hdr text/x-c++src text/x-chdr text/x-csrc text/x-java text/x-moc text/x-pascal text/x-tcl text/x-tex application/x-shellscript text/x-c text/x-c++ text/x-python"
echo ""
echo "The neovim appimage has been downloaded into $installdir."
echo "It has been marked as executable, you can now run $installdir/nvim.appimage."
echo "You should add an alias into your shrc:"
echo " alias vim=\"$installdir/nvim.appimage\""
echo "or"
echo " alias nvim=\"$installdir/nvim.appimage\""