zsh-fast-syntax-highlighting
Colours the command line as you type — invalid commands turn red before you hit Enter.
What it does
It highlights the command line live: known commands in one colour, unknown ones in red, quoted strings, paths that exist versus paths that do not, redirections, subshells. A typo or an unclosed quote is visible before the command runs.
“Fast” distinguishes it from zsh-syntax-highlighting: it re-highlights incrementally rather than re-parsing the whole buffer on every keystroke, which is what keeps long lines responsive.
# ~/.zshrc — last of the Zsh plugins
source /opt/homebrew/opt/zsh-fast-syntax-highlighting/share/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zshNotes
Load it last, after completion plugins, or its bindings get overwritten. fast-theme -l lists themes.
Alternative to
| Alternative | Type | Trade-off |
|---|---|---|
| zsh-syntax-highlighting | Open source | The original; simpler, slower on long lines |
| Fish | Open source | Highlights out of the box with nothing installed |
Install
brew install zsh-fast-syntax-highlighting