macos安装iterm2

微信公众号:乌鸦安全

1. 安装iterm2

https://zhuanlan.zhihu.com/p/37195261

https://iterm2.com/downloads.html

image.png

下载之后,对iTerm.app文件右键打开(有些时候,如果不是右键打开的话,可能会报当前文件危险,禁止打开):
image.png

将程序移动到应用程序文件夹之后,直接打开:
image.png
此时,iterm2已经安装完成了。
image.png
在这里配置设置为默认终端。

但是这个终端到我们的需求还差好多,界面看上去好丑。。。

2. 安装Zsh

直接在命令行里面输入这个语句:
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

image.png
因为网络的问题,所以在这里使用的是系统的命令加速,访问了github下载了Zsh
下载之后,重启iterm2:
image.png

此时iterm生效。

3. 优化iterm

在命令行中,使用vim ~/.zshrc打开隐藏文件,修改主题为agnoster
image.png

修改之后:使用命令source ~/.zshrc,但是发现此时的字体存在乱码。
image.png
修改乱码需要加入字体:
[https://github.com/powerline/fonts/blob/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf](https://github.com/powerline/fonts/blob/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf)
image.png
双节打开,安装字体:
image.png

打开preferences看到当前的原始数据:
image.png
在Text中,选择刚安装的字体和修改字体大小:
image.png

设置闪符

image.png
在这里可以选择配色,但是官方带的配色有限,可以从网上直接下载:
[https://iterm2colorschemes.com/](https://iterm2colorschemes.com/)

image.png

image.png
在这里选择import导入:
image.png
在这里找到刚下载的数据,选择schemes

image.png
打开之后,全选导入:
image.png

打扰iterm2之后,在这里就有所有的配色方案了:
image.png

我现在选择的是Dracula
image.png
当然,有很多的都可以选择:

4. 代码高亮

cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
vi ~/.zshrc

image.png
在这里先不使用加载,等命令补全之后再一起加载。

5. 命令补全

cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-autosuggestions
vi ~/.zshrc

image.png
找到plugins,把这个插件添加上:

plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
)
    

修改前:
image.png
修改后:

image.png

重新加载,使用命令source ~/.zshrc

image.png
此时已经生效:
image.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值