iTerm2 oh-my-zsh 配置
2025/8/20小于 1 分钟
iTerm2 oh-my-zsh 修改主题,添加插件
下载iTerm2
安装方法有两种
可以直接去官网下载:https://www.iterm2.com/
也可以使用brew
brew install --cask iterm2安装完成后,在/bin目录下会多出一个zsh的文件。
Mac系统默认使用dash作为终端,可以使用命令修改默认使用zsh:
chsh -s /bin/zsh如果想修改回默认dash,同样使用chsh命令即可:
chsh -s /bin/bash安装Oh my zsh
安装方法有两种,可以使用curl或wget,看自己环境或喜好:
# curl 安装方式
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"# wget 安装方式
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"安装主题
主题排行 https://www.slant.co/topics/7553/~theme-for-oh-my-zsh
安装主题 powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc在 ~/.zshrc 设置 ZSH_THEME="powerlevel10k/powerlevel10k"。接下来,终端会自动引导你配置 powerlevel10k。
安装插件
安装方式:把插件下载到本地的 ~/.oh-my-zsh/custom/plugins 目录。
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions