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
相关推荐
VincentFHR几秒前
Canvas 高性能K线图,支持无限左右滑动
前端·数据可视化·canvas
sophie旭4 分钟前
一道面试题,开始性能优化之旅(3)-- DNS查询+TCP(二)
前端·面试·性能优化
面向星辰9 分钟前
css选择器(继承补充)
前端·css
koooo~12 分钟前
Vue3中的依赖注入
前端·javascript·vue.js
huuyii13 分钟前
Nest 基础知识
前端
沢田纲吉16 分钟前
《LLVM IR 学习手记(三):赋值表达式与错误处理的实现与解析》
前端·编程语言·llvm
sophie旭17 分钟前
一道面试题,开始性能优化之旅(3)-- DNS查询+TCP(一)
前端·面试·性能优化
IT_陈寒1 小时前
JavaScript性能优化:这7个V8引擎技巧让我的应用速度提升了50%
前端·人工智能·后端
学渣y1 小时前
nvm下载node版本,npm -v查看版本报错
前端·npm·node.js
excel1 小时前
首屏加载优化总结
前端