Skip to content

Instantly share code, notes, and snippets.

@kaplas
Last active September 28, 2016 07:40
Show Gist options
  • Save kaplas/e503f13bd1730734bb42 to your computer and use it in GitHub Desktop.
Save kaplas/e503f13bd1730734bb42 to your computer and use it in GitHub Desktop.
Install prezto to a vagrant/*nix box with a single command
#!/bin/zsh
#
# This script installs prezto into a vagrant/*nix box which already has zsh and oh-my-zsh
# installed. It also replaces the prompt color and enables the git prezto module. If
# executed via the suggested command below, also the default shell is changed into zsh.
# BTW, if using this for a vagrant box, be sure to execute the command while ssh'd into
# the box.
#
# Usage: curl -L https://raw-gist-file-address-here.sh | zsh && chsh -s $(which zsh)
#
echo "Cloning prezto"
rm -rf "${ZDOTDIR:-$HOME}/.zprezto"
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
echo "Symlinking all requires zsh dot files"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
targetfile=${ZDOTDIR:-$HOME}/.${rcfile:t}
rm -f "$targetfile"
ln -s "$rcfile" "$targetfile"
done
echo "Set default prompt color to blue"
echo "zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{blue}❯%F{blue}❯%F{blue}❯%f%b'" \
>> ${ZDOTDIR:-$HOME}/.zshrc
echo "Include git prezto module"
sed -i "s/'prompt'/'prompt' 'git'/" ${ZDOTDIR:-$HOME}/.zpreztorc
echo "Remove git aliases from the git prezto module"
sed -i '/^alias/d' ${ZDOTDIR:-$HOME}/.zprezto/modules/git/alias.zsh
echo "Install autojump"
git clone git://github.com/joelthelion/autojump.git ${ZDOTDIR:-$HOME}/.autojump-repo
cd ~/.autojump-repo
./install.py
cd ~
echo "[[ -s ${ZDOTDIR:-$HOME}/.autojump/etc/profile.d/autojump.sh ]] && source ${ZDOTDIR:-$HOME}/.autojump/etc/profile.d/autojump.sh" \
>> ${ZDOTDIR:-$HOME}/.zshrc
echo "autoload -U compinit && compinit -u" \
>> ${ZDOTDIR:-$HOME}/.zshrc
echo "Install SCM Breeze"
git clone git://github.com/ndbroadbent/scm_breeze.git ${ZDOTDIR:-$HOME}/.scm_breeze
${ZDOTDIR:-$HOME}/.scm_breeze/install.sh
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment