Terminal autocomplete (only macOS and Linux)
How to Make your terminal smarter?
-
Install Oh My ZSH!
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
Install zsh-autosuggestions and zsh-autocomplete:
brew install zsh-autosuggestions zsh-completions
Add following to ~/.zshrc
:
source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
- Force rebuild
zcompdump
:rm -f ~/.zcompdump; compinit
Reopen the terminal, it will works.
Previous post: Migrate pip to uv