Plugin Coexistence

Lacy shares ZLE resources with zsh-autosuggestions andzsh-syntax-highlighting. Mishandling either causes visible bugs. Here's what Lacy does and why.

region_highlight — tagged entries

Multiple plugins write to the region_highlight array for syntax coloring. Lacy adds first-word coloring (green/magenta) and ghost text styling.

All Lacy entries are tagged with memo=lacy (ZSH 5.8+ feature) so they can be selectively removed on each redraw without destroying other plugins' highlights.

Warning

Never use region_highlight=() — that clears all plugins' highlights. Always filter: region_highlight=("${(@)region_highlight:#*memo=lacy*}")

bash
# Always append memo=lacy to Lacy highlight entries
region_highlight+=("0 5 bold,fg=green memo=lacy")

POSTDISPLAY — ghost text conflicts

Both Lacy (reroute ghost text) and zsh-autosuggestions (history suggestions) write to POSTDISPLAY.

When Lacy's ghost text is active (BUFFER empty), Lacy calls _zsh_autosuggest_clearbefore setting POSTDISPLAY to prevent autosuggestions from overwriting it. When the user starts typing, Lacy clears its ghost text and autosuggestions resumes normally.

Right arrow and Tab — no dot prefix

Lacy's _lacy_forward_char_or_accept and _lacy_expand_or_acceptwidgets check for Lacy ghost text first. On fallback, they call zle forward-char(not zle .forward-char).

The dot prefix bypasses widget wrapping — without it, autosuggestions' wrapper fires and right arrow / tab accept suggestions normally.

Note

Full design rationale is in the header of lib/zsh/keybindings.zsh.