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
相关推荐
2301_803554524 分钟前
vim,gcc/g++,makefile,cmake
linux·编辑器·vim
belldeep2 小时前
WSL 安装 Debian 12 后,Linux 如何安装 vim ?
linux·debian·vim
WuYiCheng6665 小时前
TLS 1.3黑魔法:从协议破解到极致性能调优
macos
piaoxue8206 小时前
Mac上安装运行SynthTIGER
macos·语言模型
小山菌8 小时前
mac中加载C++动态库文件
开发语言·c++·macos
THMAIL9 小时前
mac M芯片运行docker-desktop异常问题
macos·docker·容器
laocooon52385788615 小时前
一台入网的电脑有6要素, 机器名,mac,ip,俺码,网关,dns,分别有什么作用
网络协议·tcp/ip·macos
德亦周1 天前
如何在Mac电脑上的VScode去配置C/C++环境
c++·vscode·macos
tonngw1 天前
【Mac 从 0 到 1 保姆级配置教程 12】- 安装配置万能的编辑器 VSCode 以及常用插件
git·vscode·后端·macos·开源·编辑器·github
亚林瓜子1 天前
虚拟Python 环境构建器virtualenv安装(macOS版)
python·macos·virtualenv·pipx