Mac配置iterm2
文章目录
一:Iterm2下载和基本的配置
1:官网下载
https://www.iterm2.com/downloads.html
下载的是压缩文件,解压后是执行程序文件,你可以直接双击,或者直接将它拖到 Applications 目录下。
2:homebrew下载
如果你的电脑安装了homebrew,可以使用homebrew下载
🎉 homebrew对于mac的程序员用户来说非常的重要,甚至说必须要安装,具体安装步骤可以看我的这个文章
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
# 一个命令直接安装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:插件配置
一般来说,就需要两个常用的插件就可以了,当然这都是额外的东西,可以完全不安装插件
# 高亮
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