iTerm2 + oh-my-zsh + zsh-autosuggestion

zsh-autosuggestionoh-my-zsh的一个插件,作用基本上是根据历史输入指令的记录即时的提示,能够很大的提高效率。

一、安装iTerm2 终端工具

直接打开ITerm2官网(https://www.iterm2.com/)直接点击Download下载安装即可。

二、安装oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

  • 你很有可能遇到如下报错信息:


  • 解决办法
    在https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP。(IP可能已改变,请重新查询)

  • 然后在hosts中声明其对应ip
    sudo vim /etc/hosts
    添加如下内容:
    199.232.68.133 raw.githubusercontent.com

  • 重新执行sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"耐心等待即可。

三、安装zsh-autosuggestions

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

1.编辑~/.zshrc文件

vim ~/.zshrc

#找到plugins=(git)这一行,然后再添加autosuggestions
plugins=(git zsh-autosuggestions)

2.重新打开命令行,或者source ./zshrc更新下你的zsh,这样你就可以使用oh-my-zsh的同时享受到autosuggestions带来的便利了。

你可能感兴趣的:(iTerm2 + oh-my-zsh + zsh-autosuggestion)