Skip to content

Instantly share code, notes, and snippets.

@Dacheng-Wang
Last active January 16, 2025 02:53
Show Gist options
  • Select an option

  • Save Dacheng-Wang/7b941b60b47e9b7b2df064ec35998770 to your computer and use it in GitHub Desktop.

Select an option

Save Dacheng-Wang/7b941b60b47e9b7b2df064ec35998770 to your computer and use it in GitHub Desktop.
one click installation script for oh-my-zsh and powerlevel10k with autocomplete and highlighter plugin on Debian 12
#!/bin/bash
# Install zsh
sudo apt install git zsh -y
# Show version
zsh --version
# Set zsh as default shell
chsh -s /usr/bin/zsh
# Echo zsh.
echo $SHELL
# Logout & Login if don't see zsh as default shell.
echo "Logout & Login if don't see zsh as default shell."
# Install oh-my-zsh. https://github.com/ohmyzsh/ohmyzsh
# Assuming you have curl installed.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Use agnoster theme
# https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
# Edit ZSH_THEME
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/g' ~/.zshrc
# Install powerline font
sudo apt-get install fonts-powerline -y
# Install powerlevel10k
sudo rm -R ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# Edit zshrc and add powerlevel
sed -i 's/ZSH_THEME="agnoster"/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ~/.zshrc
# Install plugins (zsh-autosuggestions and zsh-syntax-highlighting)
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/jeffreytse/zsh-vi-mode.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-vi-mode
# Enable plugins
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-vi-mode)/g' ~/.zshrc
echo "Successfully Installed. Start new terminal and configure powerlevel10k."
echo "If p10k configuration wizard does not start automatically, run following"
echo "p10k configure"
echo "Thanks for using this script. It actually saves lot of time to install & configure zsh."
# Install EZA
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza
echo "alias c='clear' # clear terminal" >> ~/.zshrc
echo "alias l='eza -lh --icons=auto' # long list" >> ~/.zshrc
echo "alias ls='eza -1 --icons=auto' # short list" >> ~/.zshrc
echo "alias ll='eza -lha --icons=auto --sort=name --group-directories-first' # long list all" >> ~/.zshrc
echo "alias ld='eza -lhD --icons=auto' # long list dirs" >> ~/.zshrc
echo "eza installation completed"
# Install Zoxide
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
echo 'export PATH="/home/mininet/.local/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc
echo "zoxide installation completed"
# Installing AUR for Debian - this is for Neovim
sudo bash -c "$(curl -fsSL https://pacstall.dev/q/install || wget -q https://pacstall.dev/q/install -O -)"
pacstall -I neovim fzf-bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment