Mac配置iterm2

Mac配置iterm2

文章目录

一:Iterm2下载和基本的配置

1:官网下载

https://www.iterm2.com/downloads.html

下载的是压缩文件,解压后是执行程序文件,你可以直接双击,或者直接将它拖到 Applications 目录下。

2:homebrew下载

如果你的电脑安装了homebrew,可以使用homebrew下载

🎉 homebrew对于mac的程序员用户来说非常的重要,甚至说必须要安装,具体安装步骤可以看我的这个文章

shell 复制代码
brew cask install iterm2

3:配置主题

iTerm2 最常用的主题是 Solarized Dark theme,当然这个无所谓,看自己的喜好

打开 Preferences 配置界面,然后Profiles -> Colors -> Color Presets -> Solarized Dark

二:Oh My Zsh的安装和配置

Oh My Zsh 是对主题的进一步扩展,地址:https://github.com/robbyrussell/oh-my-zsh

1:下载oh my zsh

shell 复制代码
# 一个命令直接安装oh my zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# 安装好之后,需要把 Zsh 设置为当前用户的默认 Shell
chsh -s /bin/zsh  # Catalina之后好像不用,默认就是

2:下载powerline字体

很多主题需要 Meslo 字体支持,要不然会出现乱码的情况,字体下载地址

下载好之后,直接在 Mac OS 中安装即可。

然后打开 iTerm2,按Command + ,键,打开 Preferences 配置界面,然后Profiles -> Text -> Font -> Chanage Font,选择 Meslo LG M Regular for Powerline字体。

3:主题设置

有了powerline字体剩下的就比较好说了,上这里挑选一个你比较喜欢的主题,例如:agnoster

然后vim ~/.zshrc, 然后换成自己选择的主题

换好之后,输入source ~/.zshrc保存配置

4:插件配置

一般来说,就需要两个常用的插件就可以了,当然这都是额外的东西,可以完全不安装插件

shell 复制代码
# 高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git

# 自动填充
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

然后,vim ~/.zshrc, 找到plugins配置,增加这两个插件

复制代码
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

最后当然是source一下,让改变生效source ~/.zshrc

相关推荐
2501_927539301 天前
EndNote 2025 Mac 文献管理工具
macos·mac·文献管理
coderklaus2 天前
Shell 基础知识
linux·macos·shell
ACGkaka_2 天前
Mac(十)设置右键文件夹使用 idea、vscode 打开
vscode·macos·intellij-idea
I烟雨云渊T2 天前
iOS 数据持久化
macos·ios·cocoa
超级小忍4 天前
从零开始:JDK 在 Windows、macOS 和 Linux 上的下载、安装与环境变量配置
java·windows·macos
三劫散仙4 天前
mac m1上使用Kerberos访问远程linux hadoop集群的正确姿势
linux·hadoop·macos
@蓝眼睛4 天前
mac的m3芯片安装JDK8、JDK17
macos·jdk
彬彬醤4 天前
Mac怎么连接VPS?可以参考这几种方法
大数据·运维·服务器·数据库·线性代数·macos·矩阵
ka2x4 天前
Mac 电脑 IDEA 执行 Maven 出现 No route to host 问题
macos·maven·intellij-idea
易我数据恢复大师5 天前
如何在mac玩windows游戏?3个工具推荐,不用换电脑!
macos·mac·mac运行windows游戏·easeus os2go·mac玩windows游戏