Skip to main content

Bash Plugin

The Bash plugin provides in-prompt text expansion through Bash's readline interface.

Installation

Add to your ~/.bashrc:

source /path/to/shell/texpand.bash

Usage

The primary workflow is :trigger[Space]. Type a trigger and press Space to expand.

$ :hello[Space]
$ Hello World!

This opens form TUI for matches that have forms, then inserts the generated result directly into the prompt — ready for editing or execution.

Manual Expansion

Press Ctrl+T to manually expand the current prompt buffer without Space.

How It Works

The plugin captures Space and Ctrl+T via bind -x. For :trigger[Space]:

  1. The prompt buffer is sent to the te binary
  2. If the trigger is a form, the TUI opens for user input
  3. The generated text replaces READLINE_LINE
  4. The result is editable before execution

Important

Avoid using :trigger[Enter] for command builders. Enter executes the typed trigger as a shell command. Use :trigger[Space] so the expansion lands in the editable command line first.

Changing the Keybinding

Edit shell/texpand.bash and change the bind line:

# Change to Ctrl+E instead of Ctrl+T
bind -x '"\C-e": _texpand_expand'

What's Next

Set up the Fish Plugin if you use that shell.