Skip to content

Instantly share code, notes, and snippets.

@tetkuz
Last active February 6, 2016 07:16
Show Gist options
  • Save tetkuz/7e69c659bf730491dfed to your computer and use it in GitHub Desktop.
Save tetkuz/7e69c659bf730491dfed to your computer and use it in GitHub Desktop.
Simple shell script for installing nvim
#! /bin/bash
# Simple shell script for install/update nvim
# $ ./nvim-setup
# $ which nvim
# /home/user_name/usr/bin/nvim
# Var
INSTALL_DIR=$HOME/usr
UPDATE=no
# INSTALL / UPDATE
if [ `which nvim` = $HOME/usr/bin/nvim ]; then
UPDATE=yes
fi
# Prepare
## Destination dir
if [ x${UPDATE} = xno ]; then
mkdir ${INSTALL_DIR}
fi
## Source code
if [ x${UPDATE} = xno ]; then
git clone https://github.com/neovim/neovim.git
fi
cd neovim/
if [ x${UPDATE} = xyes ]; then
git remote update
git reset --hard origin/master
fi
# Build
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}"
make install
# Last messages
echo '> Please set PATH'
echo '> PATH=$PATH:${INSTALL_DIR}/bin/nvim'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment