检查zsh
版本(mac一般默认自带)
~ zsh --version
zsh 5.8 (x86_64-apple-darwin21.0)
oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
仓库目录cd ~/.oh-my-zsh
插件
插件安装的目录 cd ~/.oh-my-zsh/custom/plugins
-
autojump (自动跳转目录)
- 需要安装python@3.10
brew install python@3.10
- 安装autojump
brew install autojump
- 需要安装python@3.10
-
zsh-autosuggestions (智能提示并补全)
-
zsh-syntax-highlighting (命令行高亮)
配置
-
配置文件目录
vim ~/.zshrc
-
配置plugins
plugins=( autojump zta-autosuggestions zsh-syntax-highlighting )
-
配置themes agnoster
ZSH_THEME="agnoster"
- 需要安装字体
# clone git clone https://github.com/powerline/fonts.git --depth=1 # install cd fonts ./install.sh # clean-up a bit cd .. rm -rf fonts
-
iTerm2中配置:
Profiles-Text
-
vscode配置
"terminal.integrated.fontFamily": "Meslo LG S for Powerline"
-
隐藏主机和用户名
-
vim ~/.oh-my-zsh/themes/agnoster.zsh-theme
-
找到
prompt_context
,将代码注释
-
-
每次配置文件修改后,需要重启生效
source ~/.zshrc
iTerm2
个人习惯:
创建两个profile
- 正常显示
- 设置快捷热键 double click
- 全屏显示
- 设置快捷热键 组合键