Skip to content

Instantly share code, notes, and snippets.

@mzaidannas
Last active March 25, 2021 05:31
Show Gist options
  • Save mzaidannas/a8612de8b639abe68026299fd2733817 to your computer and use it in GitHub Desktop.
Save mzaidannas/a8612de8b639abe68026299fd2733817 to your computer and use it in GitHub Desktop.
Setup ZSH plugins, theme and fonts
#!/usr/bin/env zsh
# Download required fonts to user font path
mkdir -p ~/.local/share/fonts
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Retina/complete/Fira%20Code%20Retina%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Retina Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Bold/complete/Fira%20Code%20Bold%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Bold Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Light/complete/Fira%20Code%20Light%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Light Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Medium/complete/Fira%20Code%20Medium%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Medium Nerd Font Complete.ttf"
curl -fsSL https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/FiraCode/Regular/complete/Fira%20Code%20Regular%20Nerd%20Font%20Complete.ttf -o "${HOME}/.local/share/fonts/Fira Code Regular Nerd Font Complete.ttf"
# Refresh font cache
fc-cache
# Install oh-my-zsh plugin manager for zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Get plugins
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-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Set plugins
sed -i '/^plugins=/s/\(.*\)$/plugins=\(\n\tgit\n\tzsh-completions\n\tzsh-autosuggestions\n\tzsh-syntax-highlighting\n\thistory-substring-search\n\)/gm' ~/.zshrc
# Get theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
# Set theme
sed -i '/^ZSH_THEME=/s/".*"$/"powerlevel10k/powerlevel10k"/gm' ~/.zshrc
tee -a ~/.zshrc << EOF
autoload -U compinit && compinit
EOF
p10k configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment