Skip to content

Instantly share code, notes, and snippets.

@drasbeck
Last active August 6, 2020 16:28
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 drasbeck/1087209df98172efd19cc54fb7b33cd2 to your computer and use it in GitHub Desktop.
Save drasbeck/1087209df98172efd19cc54fb7b33cd2 to your computer and use it in GitHub Desktop.
From 0 to Z shell
#!/bin/bash
# A simple script to get Z shell up and running with oh my zsh,
# zsh-autosuggestions, zsh-syntaxhighlighting and Pure prompt.
# install prerequisites
sudo apt install -y git curl
# install zsh
sudo apt install -y zsh
# install oh my zsh
printf "\nFor this script to finish press Ctrl + D to exit Z shell\n"
printf "when oh my zsh has finished installing\n"
printf "\nFor now press ENTER to continue ...\n"
read z
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install extenstions (zsh-autosuggestions and zsh-syntaxhighlighting)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# activate extenstions in .zshrc
sed -i 's/plugins=(git/plugins=(git zsh-autosuggestions zsh-syntax-highlighting/g' ~/.zshrc
# install Pure prompt by Sindre Sorhus, https://github.com/sindresorhus/pure
mkdir -p "$HOME/.zsh"
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"
echo "fpath+=$HOME/.zsh/pure" >> ~/.zshrc
echo "autoload -U promptinit; promptinit" >> ~/.zshrc
echo "prompt pure" >> ~/.zshrc
# outro
printf "\nDONE\n"
printf "\nNext time you log in, you will be using the Z shell\n"
printf "Type 'zsh' to access it now.\n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment