Mac 终端美化显示

Linux 也可安装 Zsh 后使用此套配置。

1. 安装 Oh My Zsh

bash 复制代码
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

2. 更换主题,修改文件:~/.zshrc,原内容: ZSH_THEME="robbyrussell" 替换为: ZSH_THEME="agnoster"

3. 安装 Powerline 字体修正显示乱码

bash 复制代码
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts

4. 修改 iTerm2 或者其他终端使用名称后缀带 Powerline 的字体,如: Source Code Pro for Powerline;Visual Studio Code 可保留原有字体配置,添加新字体即可,注意名称两边包上单引号

5. 修改文件:~/.zshrc,添加一行内容: export DEFAULT_USER=$USER,隐藏显示用户名和主机名

6. Oh My Zsh 安装命令高亮插件

bash 复制代码
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

7. Oh My Zsh 安装命令自动补全插件

bash 复制代码
git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

8. Oh My Zsh 启用之前安装的2个插件,修改文件:~/.zshrc,原内容: plugins=(git) 替换为: plugins=(git zsh-syntax-highlighting zsh-autosuggestions)

9. 修改 Vim 编辑器配置:~/.vimrc, 开启语法和搜索高亮及行号显示

text 复制代码
syntax on
set hlsearch
set number
相关推荐
帅次8 小时前
Objective-C面向对象编程:类、对象、方法详解(保姆级教程)
flutter·macos·ios·objective-c·iphone·swift·safari
fengyun28919 小时前
Mac电脑 卸载工具 App Cleaner
macos
aerror13 小时前
Xbox One 控制器转换为 macOS HID 设备的工作原理分析
macos·xbox
GDAL13 小时前
Node.js REPL 教程
node.js·编辑器·vim
OLong14 小时前
2025年最强React插件,支持大量快捷操作
前端·react.js·visual studio code
晴风向上14 小时前
mac mini m4安装node.js@16以下版本方法
macos·node.js
JPCstorm16 小时前
Mac homebrew 安装教程
macos
秋窗716 小时前
Mac 部署Latex OCR并优化体验(打包成App并支持全局快捷键)
macos·ocr·latex
FreeBuf_16 小时前
朝鲜APT组织使用Nim语言恶意软件对macOS发起隐秘Web3与加密货币攻击
macos·web3·策略模式
一眼万年0419 小时前
每天都在使用的VS Code Copilot Chat 开源啦!
aigc·ai编程·visual studio code