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
相关推荐
未来侦察班31 分钟前
一晃13年过去了,苹果的Airdrop依然很坚挺。
macos·ios·苹果vision pro
普通网友5 小时前
苹果笔记本(Mac)连接手机完全指南
macos·智能手机
Aftery的博客7 小时前
Xcode运行报错:SDK does not contain ‘libarclite‘ at the path
macos·cocoa·xcode
嵌入小生0079 小时前
标准IO---核心函数接口延续(嵌入式Linux)
c语言·vscode·vim·嵌入式·小白·标准io·函数接口
Doro再努力10 小时前
【Linux操作系统12】Git版本控制与GDB调试:从入门到实践
linux·运维·服务器·git·vim
楚轩努力变强14 小时前
iOS 自动化环境配置指南 (Appium + WebDriverAgent)
javascript·学习·macos·ios·appium·自动化
好好学习天天向上~~16 小时前
5_Linux学习总结_vim
linux·学习·vim
Doro再努力1 天前
Vim 快速上手实操手册:从入门到生产环境实战
linux·编辑器·vim
Doro再努力1 天前
【Linux操作系统10】Makefile深度解析:从依赖推导到有效编译
android·linux·运维·服务器·编辑器·vim
执风挽^1 天前
Python基础编程题2
开发语言·python·算法·visual studio code