Iterm2 终端安装(带语法提示)

手动安装插件

sh 复制代码
# 创建插件目录(如不存在)
mkdir -p ~/.oh-my-zsh/custom/plugins

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

# 安装 zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

# 安装 zsh-completions
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions

修改 .zshrc 插件设置

sh 复制代码
vim ~/.zshrc
sh 复制代码
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="agnoster"  # 主题可换成 robbyrussell、powerlevel10k 等

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
  zsh-completions
)

source $ZSH/oh-my-zsh.sh

# 插件路径(根据 brew 路径修改)
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# 历史命令记录设置
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000

# 配色支持
export TERM="xterm-256color"

# 美化 ls
alias ls='ls -G'

# 显示隐藏文件
alias lsa='ls -la'

# 清屏快捷
alias cls='clear'
sh 复制代码
# 保存刷新
source ~/.zshrc
相关推荐
猫头虎-前端技术7 小时前
浏览器兼容性问题全解:CSS 前缀、Grid/Flex 布局兼容方案与跨浏览器调试技巧
前端·css·node.js·bootstrap·ecmascript·css3·媒体
阿珊和她的猫7 小时前
探索 CSS 过渡:打造流畅网页交互体验
前端·css
元亓亓亓7 小时前
JavaWeb--day1--HTML&CSS
前端·css·html
β添砖java7 小时前
CSS的文本样式
前端·css
前端小趴菜057 小时前
css - 滤镜
前端·css
祈祷苍天赐我java之术7 小时前
理解 CSS 浮动技术
前端·css
索迪迈科技7 小时前
Flex布局——详解
前端·html·css3·html5
咔咔一顿操作7 小时前
【CSS 3D 实战】从零实现旋转立方体:理解 3D 空间的核心原理
前端·css·3d·css3
DONG9137 小时前
深度解析CSS单位与媒体查询:构建现代化响应式布局的核心技术
前端·css·html·css3·媒体