Cover image for zsh

zsh

Words 227
Views
Visitors

Timeline

Timeline

2025-10-20

init

This article introduces the method of installing and configuring zsh in a WSL environment, including specific steps for migrating .bashrc configurations to .zshrc, setting themes, and installing plugins such as zsh-autosuggestions and zsh-syntax-highlighting.

Environment
Environment

Note that Fira Code Nerd Font is used in WSL

zsh installation

1
2
3
4
5
6
sudo pacman -Sy zsh
# Change the default shell to zsh
chsh -s /bin/zsh
# Install oh-my-zsh
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh

Configuration

bashrc migration

Copy the previous .bashrc configuration to the bottom of .zshrc

1
2
3
4
5
alias grep='grep --color=auto'
alias ll="ls -alF"
alias ls="exa --icons"

source /home/zhaohang/.env.sh

Theme

1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Set in ~/.zshrc:

1
ZSH_THEME="powerlevel10k/powerlevel10k"

and then

1
source ~/.zshrc

Then just follow the prompts to select

Plugins

zsh-autosuggestions

1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-syntax-highlighting

1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Set in ~/.zshrc:

1
plugins=(git zsh-autosuggestions zsh-syntax-highlighting z extract web-search)

and then

1
source ~/.zshrc

effect

zsh+tmux
zsh+tmux