Skip to content
zsh-fast-syntax-highlighting

zsh-fast-syntax-highlighting

Colours the command line as you type — invalid commands turn red before you hit Enter.

Homebrew formula

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.zsh

Notes

Load it last, after completion plugins, or its bindings get overwritten. fast-theme -l lists themes.

Alternative to

AlternativeTypeTrade-off
zsh-syntax-highlightingOpen sourceThe original; simpler, slower on long lines
FishOpen sourceHighlights out of the box with nothing installed

Install

brew install zsh-fast-syntax-highlighting

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on