Terminal autocomplete (only macOS and Linux)

5 Leave a Comment

How to Make your terminal smarter?

  1. Install Oh My ZSH!

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  2. 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
  1. Force rebuild zcompdump:
    rm -f ~/.zcompdump; compinit

Reopen the terminal, it will works.

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *