Enable Autosuggestions in Your Shell

· 1 min read · 145 Words · -Views -Comments

Some terminals show ghosted command suggestions as you type. Press → to accept them instantly—that feature is called autosuggestion.

Autosuggestion vs. Autocompletion

They’re different concepts.

  1. Autosuggestion leverages history or heuristics to display a full command after the cursor. Press one key to accept it.

    https://static.1991421.cn/2024/2024-06-10-131006.jpeg

  2. Autocompletion uses command metadata to offer options when you press a trigger key (usually Tab). It doesn’t fill the entire command—just the current argument—and often produces multiple candidates.

    https://static.1991421.cn/2024/2024-06-10-223521.jpeg

Both can coexist without conflict.

Enabling Autosuggestions

Each shell handles it differently.

Bash

No official community solution yet. Some terminals, like Warp, implement their own.

Zsh

Install via Oh My Zsh:

# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Enable the zsh-autosuggestions plugin
plugins=(
  ...
  zsh-autosuggestions
)

Fish

Fish ships with autosuggestions enabled—no extra configuration required.

Final Thoughts

Turn on autosuggestions. Many commands repeat; accepting suggestions saves time and effort.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover