Skip to content

Instantly share code, notes, and snippets.

@gigadot
Last active September 2, 2023 10:41
Show Gist options
  • Save gigadot/91d42da68ccdcc5d6f627932a7725893 to your computer and use it in GitHub Desktop.
Save gigadot/91d42da68ccdcc5d6f627932a7725893 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install zsh
# > sudo apt install zsh
# > chsh -s $(which zsh)
# On cygwin, use cygwin setup to install zsh and install fonts by downloading fonts and manually install on Windows
# Install oh-my-zsh
# > sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "1. Installing powerlevel10k theme..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed -i 's@^ZSH_THEME=.*$@ZSH_THEME="powerlevel10k/powerlevel10k"@g' ~/.zshrc
echo ""
echo "2. Installing powerline fonts...(Not needed for Linux)"
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir -p ~/.local/share/fonts/
mv PowerlineSymbols.otf ~/.local/share/fonts/
fc-cache -vf ~/.local/share/fonts/
mkdir -p ~/.config/fontconfig/conf.d/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
echo ""
echo "3. Installing autosuggestions, syntax highlighting and z..."
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z
sed -i 's@plugins=(git)@plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-z)@g' ~/.zshrc
echo ""
echo "Finish! Log out of your session and login again to configure p10k for the first time."
echo "4. Configure the interface..."
emacs .p10k.zsh
# typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# context <-- add this
# ...
# )
# typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# ...
# # context <-- disable this
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment