item2 for macos

安装Item2

复制代码
brew install iterm2

查看终端类型

复制代码
cat /etc/shells

Mac OS X 10.15 已经将默认的shell从Bash换成了zsh,所以不用安装,10.15以前的可以使用下面的命令进行安装

复制代码
brew install zsh

安装Oh My ZSH

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

安装powerlevel10k ---个人不喜欢

powerlevel10k 是一款 zsh 主题,是 powerlevel9k 的升级版,强调快速、高效和开箱即用。powerlevel10k 免去了之前 powerlevel9k 比较繁琐的安装方式,如安装字体,配置样式、修改主题等一系列繁琐的操作,开箱即用,非常简单。

安装

复制代码
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc

在代码拉取成功后,执行命令

复制代码
source ~/.zshrc

更改字形

字型的方式為 iTerm → Preferences → Profiles → Text → Font 。把 Font 改成 MesloLGS NF

改他是因为有的字符这个字体适配好

p10k配置

复制代码
p10k configure

这里会进行交互式的配置,只需根据提示进行选择即可。

安装插件

插件zsh-autosuggestions

命令自动补全

复制代码
# zsh-autosuggestion
git clone https://github.com/zsh-users/zsh-autosuggestions.git  ~/.oh-my-zsh/plugins/zsh-autosuggestions

插件zsh-syntax-highlighting

可以在命令行高亮显示语法

复制代码
# zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git  ~/.oh-my-zsh/plugins/zsh-syntax-highlighting

安装好之后,需要修改 .zshrc

复制代码
vim ~/.zshrc

修改zshrc

插件
复制代码
# .zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

主题

复制代码
# .zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"

这个主题是使用p10k的情况下改的,如果不使用就不用改,不使用的可以看第一个引用链接

可以进入『Oh My Zsh』项目 Wiki 查看个个主题。

修改完成后,执行命令,完成设置:

复制代码
source ~/.zshrc

结果

macOS iTerm2 美化配置笔记 | Liarr's Studio

美化 macOS iTerm2 - Oh My Zsh + 一些好用的插件 | 成功他媽.阿瑋

使用 iterm2 打造美观高效的 mac 终端 - 木子欢儿 - 博客园

相关推荐
vi_h1 天前
在 macOS 上通过 Docker 安装并运行 Ollama(详细可执行教程)
macos·docker·ollama
pe7er6 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
harmful_sheep9 天前
mac生效的终端查看
macos
iOS门童10 天前
macOS 应用"已损坏"无法打开?一文搞懂 Gatekeeper 与解决方案
macos
NPE~10 天前
[工具分享]Maccy —— 优雅的 macOS 剪贴板历史管理工具
macos·教程·工具·实用工具
差不多程序员10 天前
Mac安装OpenClaw-cn保姆级教程
macos
dzl8439410 天前
mac 安装python
开发语言·python·macos
Bruce_Liuxiaowei10 天前
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程
macos·docker·容器·openclaw
阿捏利10 天前
详解Mach-O(十五)Mach-O __DATA_CONST
macos·ios·c/c++·mach-o
ShikiSuen10 天前
macOS 的 CpLk 中英切换卡顿的元凶在 InputMethodKit 本身
macos