使用的是托管在
github.com上的zsh-autosuggestions插件,
地址 https://github.com/tarruda/zsh-autosuggestions
预先
安装了
git安装了
zsh,
地址https://github.com/tarruda/zsh-autosuggestions
和 http://zhuanlan.zhihu.com/mactalk/19556676
步骤 1. git clone下载插件源码
通过命令行下载到了
~/.zsh/zsh-autosuggestions目录中,通过cd可查看git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
步骤2. 打开~/.zshrc进行配置
2.1复制以下代码
# Load zsh-syntax-highlighting.
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Load zsh-autosuggestions.
source ~/.zsh/zsh-autosuggestions/autosuggestions.zsh
# Enable autosuggestions automatically.
zle-line-init() {
zle autosuggest-start
}
zle -N zle-line-init
2.2 打开命令行工具进入~/.zshrc文件并粘贴2.1中的代码
vim ~/.zshrc按
i进入--INSERT--编辑模式,使用上下左右键找个地方粘贴即可(快捷键可用)
2.3 保存退出
ESC 回到正常模式:wq保存并退出vimvim的简单使用参考:
重新打开终端即可看到提示效果
灰色即为提示

**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用。你还可以使用@来通知其他用户。