Mac下命令行自动提示

时间:2022-10-11 14:52:08

命令行提示工具,便于命令的正确书写,效果如图:
Mac下命令行自动提示

tarruda/zsh-autosuggestions 下参考Manually 项安装。

Manually
1、Clone this repository to ~/.zsh/zsh-autosuggestions (or anywhere else):
git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh/zsh-autosuggestions

2、Clone zsh-syntax-highlighting repository to ~/.zsh/zsh-syntax-highlighting (or anywhere else):
git clone git://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting

3、Load and enable autosuggestions; copy the following snippet and put it to your .zshrc file:
# 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

4、Reopen your terminal.