iterm2+zsh命令自动补全

iterm2

下载

地址: https://iterm2.com/

设置为默认terminal

title

设置默认Shell

1
2
3
4
5
6
7
8
#查看系统安装的所有Shell
cat /etc/Shells

#修改默认Shell为zsh
chsh -s /bin/zsh

#查看当前使用的Shell
echo $Shell

zsh命令自动补全插件

安装

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

配置

1
2
3
4
5
6
7
8
9
10
#编辑配置文件
vim ~/.zshrc

#找到plugins配置,在括号内增加zsh-autosuggestions,与其他插件之间使用空格分隔开
plugins=(git zsh-autosuggestions)
source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.bash_profile # source一下其他环境变量

#退出编辑后执行使配置生效
source ~/.zshrc

效果

title


iterm2+zsh命令自动补全
https://zhangfuli.github.io/2023/09/13/iterm2-zsh命令自动补全/
作者
张富利
发布于
2023年9月13日
许可协议