explaingit

zsh-users/zsh-autosuggestions

35,516ShellAudience · developerComplexity · 2/5QuietLicenseSetup · easy

TLDR

A Zsh plugin that shows command suggestions in gray as you type, based on your history, so you can accept them with one keypress instead of retyping.

Mindmap

mindmap
  root((repo))
    What it does
      Shows gray suggestions
      Matches command history
      Updates as you type
    How to use
      Clone repository
      Add one line to config
      Press right arrow to accept
    Use cases
      Speed up repetitive commands
      Reduce typing errors
      Learn command syntax
    Tech stack
      Zsh shell
      Shell script
      Unix systems
    Compatibility
      Oh My Zsh
      Prezto
      Any Zsh framework

Things people build with this

USE CASE 1

Speed up typing of frequently-used commands by accepting suggestions with a single keypress.

USE CASE 2

Reduce typos and mistakes when entering complex commands by seeing the full command before executing it.

USE CASE 3

Discover and remember command syntax by seeing suggestions based on your own past usage patterns.

USE CASE 4

Navigate your shell faster without needing to manually search through history or use tab completion.

Tech stack

ZshShell script

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

zsh-autosuggestions is a plugin for Zsh, a popular Unix command-line shell, that shows command suggestions in gray text as you type, based on your command history. The problem it solves is that retyping commands you have used before is tedious and slow. Fish, another shell, pioneered this approach, and this plugin brings the same behavior to Zsh. The way it works is straightforward: as you type each character, the plugin looks through your shell history (and optionally your tab-completion candidates) to find the most recent command that starts with what you have typed so far. If it finds a match, the rest of that command appears grayed out to the right of your cursor. You accept the suggestion by pressing the right arrow key or End key, which fills in the full command without you having to type the rest. If you keep typing, the suggestion updates dynamically to match your new input. You can also accept only one word at a time using a separate keybinding. Installation is straightforward: you clone the repository, add a single line to your .zshrc configuration file, and the plugin activates automatically in every new terminal session. It is compatible with Oh My Zsh, Prezto, and other Zsh framework managers, so users of those frameworks can install it with even less manual setup. A developer or system administrator who uses Zsh as their terminal shell and wants faster command-line navigation without memorizing full command syntax would use zsh-autosuggestions. It is written in Shell script and works on any Unix system running Zsh.

Copy-paste prompts

Prompt 1
How do I install zsh-autosuggestions and set it up in my .zshrc file?
Prompt 2
Show me how to customize the keybindings in zsh-autosuggestions to accept suggestions with a different key.
Prompt 3
How can I make zsh-autosuggestions suggest commands from tab-completion candidates in addition to history?
Prompt 4
What are the performance implications of using zsh-autosuggestions with a very large command history?
Prompt 5
How do I troubleshoot zsh-autosuggestions if suggestions aren't appearing or are appearing incorrectly?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.