Installing neovim on any Linux machine e.g. a shared hosting server

Once in while, I need to edit files on a shared hosting server. I have ssh access but no permission to install anything (dah! it’s shared hosting.). The bare-bone vi doesn’t cut it for me, and I am never going to use cpanel web-editor like a cave-dude!

Fortunately there is way to install neovim on sharing hosting servers. The official instructions are here.

I wrote this script to automate the process.

#!/usr/bin/env bash
    mkdir -p ~/.cache
    cd ~/.cache
    if [ ! -f ./nvim.appimage ]; then
        curl -LO 
        chmod u+x nvim.appimage

    chmod a+x nvim.appimage
    ./nvim.appimage --appimage-extract 
    mv squashfs-root ~/

    # skip this if you want your own configuration.
    if [ ! -d ~/.config/nvim ]; then
        cd ~/.config && git clone --recursive
    echo "Make sure ~/squashfs-root/usr/bin is in path"

    # From
    LINE='alias vim=$HOME/squashfs-root/usr/bin/nvim'
    grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"

    source ~/.bashrc

You can get this script from

Leave a Reply