- 安装oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- 安装powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
- Set
ZSH_THEME="powerlevel10k/powerlevel10k"
in ~/.zshrc
.
- 安装字体 Meslo Nerd Font
- 命令行工具选择字体
- Apple Terminal: Open Terminal → Preferences → Profiles → Text, click Change under Font and select
MesloLGS NF
family.
- powerlevel10k config
p10k configure
- 安装插件
// 安装zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
// 安装zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- ~/.zshrc编辑plugins
plugins=(
git
z
zsh-autosuggestions
zsh-syntax-highlighting
)
- 解决prompt粘贴卡顿问题,~/.zshrc文件新增如下字段
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
- 刷新source
source ~/.zshrc