Hysen Labs
Open-source project
zsh-users/zsh-autosuggestions avatar
zsh-users

zsh-autosuggestions

Fish-like autosuggestions for zsh

35,974 stars1,937 forksShellMIT
01
DEEP OPEN-SOURCE ANALYSIS

zsh-autosuggestions: gray text that finishes your commands

A zsh plugin that offers fish like completions as you type, accepts them with the right arrow or End key, and lets you restyle the suggestion color.

02
DEEP OPEN-SOURCE ANALYSIS

What shows up as you type

The plugin offers fish like autosuggestions for zsh. As you type a command, a completion appears after the cursor in a muted gray color, which can be changed by setting a highlight style variable. The effect is a constant preview of what your command will probably become. The plugin does not block typing; the suggestion only appears as a hint. Shell is the primary language and the license is MIT.

03
DEEP OPEN-SOURCE ANALYSIS

Accepting a suggestion

With the cursor at the end of the buffer, pressing the right arrow key or the End key accepts the suggestion and replaces the command line contents with it. Invoking the forward word widget partially accepts the suggestion, up to the point the cursor moves to. Both behaviors mirror what fish users already expect, and the widget based model keeps the whole flow keyboard driven.

04
DEEP OPEN-SOURCE ANALYSIS

Configuration options

Default global config variables can be overridden, with default values available for reference. For Oh My Zsh users, the configuration can be placed in a file in a custom directory. The README keeps the settings surface small, which fits a plugin whose entire job is one line of behavior. There is little to configure, and the section stays short because of it.

05
DEEP OPEN-SOURCE ANALYSIS

Scope of the README

The README sticks close to usage and configuration: how suggestions render, which keys accept them, and where to put your settings. The description on GitHub sums it up as fish like autosuggestions for zsh. The narrow scope keeps the plugin easy to reason about.

07
DEEP OPEN-SOURCE ANALYSIS

Official sources

08
Community notes

Community notes