#!/bin/env bash # Check if OMZ exists. If not, complain. if [ ! -d "$HOME/.oh-my-zsh" ]; then echo 'Installing Oh My Zsh (0/2)...' OLD_PWD=$(pwd) cd $HOME sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --keep-zshrc --unattended" cd $OLD_PWD _S=$(awk -F: -v user="$USER" '$1 == user {print $NF}' /etc/passwd) if [ "$_S" != "/bin/zsh" ] && [ "$_S" != "/usr/bin/zsh" ]; then echo 'Changing shell to Zsh...' sudo chsh -s "/bin/zsh" $USER fi echo 'Oh My Zsh installed.' fi # Install syntax highlighting echo 'Installing syntax highlighting (1/2)...' git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting # Install autosuggestions echo 'Installing auto-suggestions (2/2)...' git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions echo 'Done.'