Description
Fish-like autosuggestions for Zsh that suggest commands as you type based on history and completions, displayed in muted gray.
Github
Essential Commands
- Right Arrow (→) or End - Accept full suggestion
- Ctrl+F or Alt+F - Accept suggestion word by word
- Escape - Clear current suggestion
- Tab - Accept suggestion and show completions
Configuration Variables
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE
- Customize suggestion color/styleZSH_AUTOSUGGEST_STRATEGY
- Set suggestion strategyZSH_AUTOSUGGEST_BUFFER_MAX_SIZE
- Disable for large buffers
Installation
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Add to plugins in .zshrc
plugins=(zsh-autosuggestions)
Usage Examples
# Customization in .zshrc
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ff00ff,bg=cyan,bold"
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
# Workflow:
# Type: "git sta" → sees "git status" → press → to accept
# Type: "cd pro" → sees "cd projects/" → press → to accept
# Type: "npm run" → sees "npm run dev" → press → to accept