开启自动补全

以zsh为例。

1. 下载autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions

2. 配置~/.zshrc

HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVESIZE=10000
SAVEHIST=10000

setopt HIST_IGNORE_ALL_DUPS
setopt INC_APPEND_HISTORY        # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY             # Share history between all sessions.
setopt HIST_IGNORE_DUPS          # Do not record an event that was just recorded again.
setopt HIST_IGNORE_SPACE         # Do not record an event starting with a space.
setopt APPEND_HISTORY            # append to history file

source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

最后更新于