时间轴

2025-10-20

init


环境

注意在WSL中使用了FiraCode Nerd Font

zsh安装

1
2
3
4
5
6
sudo pacman -Sy zsh
# 更改默认终端为zsh
chsh -s /bin/zsh
# 安装oh-my-zsh
wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh

配置

bashrc迁移

把之前.bashrc的配置复制到.zshrc下面

1
2
3
4
5
6
7
8
9
10
alias ls='ls --color=auto'
alias grep='grep --color=auto'
PS1='[\u@\h \W]\$ '
. "$HOME/.cargo/env"


alias ll="ls -alF"
alias ls="exa --icons"

source /home/zhaohang/.env.sh

主题

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

在~/.zshrc中设置:

1
ZSH_THEME="powerlevel10k/powerlevel10k"

然后

1
source ~/.zshrc

接下来根据提示选择即可

插件

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

在~/.zshrc中设置:

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

然后

1
source ~/.zshrc

效果

zsh+tmux