#! /usr/bin/env sh start_dir=$(pwd) bin_string="export PATH=\"${PATH}:${HOME}/.vimpkg/bin\"" # Download the apt-vim files curl -fSsLo ${HOME}/apt-vim/apt-vim --create-dirs \ https://raw.githubusercontent.com/egalpin/apt-vim/master/apt-vim curl -fSsLo ${HOME}/apt-vim/vim_config.json \ https://raw.githubusercontent.com/egalpin/apt-vim/master/vim_config.json # Add vimrc if there isn't one already [ -f ${HOME}/.vimrc ] || touch ${HOME}/.vimrc # Make sure vimrc is using pathogen if [ $(grep -c "execute pathogen#infect()" ${HOME}/.vimrc) -eq 0 ]; then echo "execute pathogen#infect()" >> ${HOME}/.vimrc fi if [ $(grep -c "call pathogen#helptags()" ${HOME}/.vimrc) -eq 0 ]; then echo "call pathogen#helptags()" >> ${HOME}/.vimrc fi # Update path for executing shell eval "$bin_string" added_to_profile=false already_present=false for rc in bashrc zshrc bash_profile; do if [ -s "$HOME/.$rc" ]; then if grep -q "$bin_string" "$HOME/.$rc"; then already_present=true else printf "\n$bin_string\n" >> "$HOME/.$rc" printf "== Added apt-vim PATH to '~/.$rc'\n" added_to_profile=true fi fi done # Execute apt-vim init cd ${HOME}/apt-vim python - <