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
相关推荐
恋猫de小郭3 分钟前
Apple 的 ANE 被挖掘,AI 硬件公开,宣传的 38 TOPS 居然是"数字游戏"?
前端·人工智能·ios
小岛前端7 分钟前
Node.js 宣布重大调整,运行十年的规则要改了!
前端·node.js
OpenTiny社区8 分钟前
OpenTiny NEXT-SDK 重磅发布:四步把你的前端应用变成智能应用
前端·javascript·ai编程
梦想CAD控件24 分钟前
在线CAD开发包结构与功能说明
前端·javascript·vue.js
张拭心29 分钟前
春节后,有些公司明确要求 AI 经验了
android·前端·人工智能
时光不负努力30 分钟前
typescript常用的dom 元素类型
前端·typescript
小怪点点35 分钟前
大文件切片上传
前端
时光不负努力36 分钟前
TS 常用工具类型
前端·javascript·typescript
SuperEugene37 分钟前
Vue状态管理扫盲篇:Vuex 到 Pinia | 为什么大家都在迁移?核心用法对比
前端·vue.js·面试
张拭心39 分钟前
Android 17 来了!新特性介绍与适配建议
android·前端