Skip to main content

Zsh Plugin

The Zsh plugin hooks into ZLE (Zsh Line Editor) to provide in-prompt text expansion.

Installation

Add to your ~/.zshrc:

source /path/to/shell/cli-expander.zsh

How It Works

The plugin overrides the self-insert ZLE widget to track typed characters. When you press the expand keybinding, it passes the current buffer to cli-expander expand.

Usage

Type a trigger in your shell prompt and press Ctrl+T:

$ Say :hello to everyone
^ press Ctrl+T
$ Say Hello World! to everyone

Automatic Expansion

The plugin automatically checks for triggers as you type. Type a trigger like :hello followed by a space, and the plugin attempts expansion automatically.

Changing the Keybinding

Edit shell/cli-expander.zsh and change the bindkey line:

# Change to Ctrl+E instead of Ctrl+T
zle -N _cli_expander_manual_expand
bindkey '^E' _cli_expander_manual_expand

FZF trigger search (Ctrl+F/Alt+F) is not yet available for Zsh. This feature is planned and tracked in Phase 15. The Bash plugin currently has the only shell-native fzf integration.

For now, Zsh users can use:

  • Ctrl+T for manual trigger expansion
  • The Tmux popup picker (prefix+Ctrl+g) if using tmux
  • ce list and ce search <query> directly from the command line

Compatibility

The plugin is designed to be compatible with:

  • zsh-autosuggestions
  • zsh-syntax-highlighting
  • Powerlevel10k prompt

Load cli-expander after other plugins for best compatibility.

What's Next

Set up the Bash Plugin or Fish Plugin if you use those shells.