Skip to content

Instantly share code, notes, and snippets.

@EmilMaric
Last active November 7, 2015 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmilMaric/a2d986e2ccb7dc7be4ce to your computer and use it in GitHub Desktop.
Save EmilMaric/a2d986e2ccb7dc7be4ce to your computer and use it in GitHub Desktop.
Script to install neovim on UBC servers
#!/bin/sh
DEPS="$HOME/local/"
BIN="$DEPS/bin"
# Kill script if any command exits with non-zero exit status
set -e
mkdir -p $BIN
curl -LO https://github.com/neovim/neovim/archive/v0.1.0.tar.gz
tar zxvf v0.1.0.tar.gz
cd neovim-0.1.0
echo "====================="
echo "Building dependencies"
echo "====================="
mkdir .deps
cd .deps
cmake ../third-party/
make
rsync -au usr/ $DEPS
cd ..
echo "==============="
echo "Building neovim"
echo "==============="
mkdir build
cd build
cmake -DDEPS_PREFIX=$DEPS ..
make
echo "=============="
echo "Install neovim"
echo "=============="
cp bin/nvim $BIN
cd ..
mkdir -p $HOME/share/nvim
rsync -au runtime/ $HOME/share/nvim
echo "==============="
echo "Create symlinks"
echo "==============="
ln -s ~/.vimrc ~/.nvimrc
ln -s ~/.vim ~/.nvim
echo "============================="
echo "Cleaning up..."
cd ..
rm -rf neovim-0.1.0
rm -rf v0.1.0.tar.gz
echo "Neovim installed successfully!"
echo "============================="

Make sure you add the following lines to your .bashrc/.bash_profile:

export VIMRUNTIME=$HOME/local/share/nvim
alias vim='nvim -u ~/.nvimrc'

Also add the following to the top of your .vimrc:

if has ('nvim')
    let &rtp .= ',~/.nvim"
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment