zsh-syntax-highlighting
brew install zsh-syntax-highlighting
v0.8.0
BSD-3-Clause
Fish shell-like syntax highlighting for Zsh that color-codes commands as you type.
Why you might care
Instantly spot syntax errors and invalid commands before pressing Enter. Works by hooking into Zsh's line editor to highlight valid commands, options, and paths in different colors. Essential quality-of-life plugin for interactive Zsh users; must be sourced last in .zshrc.
5.1k
30-day installs · #594
18.2k
90-day · #560
65.5k
365-day · #564
22.8k
★ GitHub stars · updated 4mo ago
GitHub topics
screenshot
shell
syntax-highlighting
zsh
zsh-syntax-highlighting
Links
- https://github.com/zsh-users/zsh-syntax-highlighting
- GitHub: zsh-users/zsh-syntax-highlighting
- Brew formula source: Formula/z/zsh-syntax-highlighting.rb
Caveats
To activate the syntax highlighting, add the following at the end of your .zshrc: source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh If you receive "highlighters directory not found" error message, you may need to add the following to your .zshenv: export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/highlighters
Blurb generated by claude-haiku-4-5 on today.
Raw metadata
{
"aliases": [],
"alternatives": [
"fish",
"zsh-autosuggestions",
"starship"
],
"build_dependencies": [],
"categories": [
"shell-prompt",
"shell"
],
"caveats": "To activate the syntax highlighting, add the following at the end of your .zshrc:\n source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\n\nIf you receive \"highlighters directory not found\" error message,\nyou may need to add the following to your .zshenv:\n export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=$HOMEBREW_PREFIX/share/zsh-syntax-highlighting/highlighters\n",
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Fish shell like syntax highlighting for zsh",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:40:58+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "zsh-syntax-highlighting",
"github_default_branch": "master",
"github_last_commit_at": "2026-02-08T16:50:52Z",
"github_readme_excerpt": "zsh-syntax-highlighting [![Build Status][build-status-image]][build-status]\n=======================\n\n**[Fish shell][fish]-like syntax highlighting for [Zsh][zsh].**\n\n*Requirements: zsh 4.3.11+.*\n\n[fish]: https://fishshell.com/\n[zsh]: https://www.zsh.org/\n\nThis package provides syntax highlighting for the shell zsh. It enables\nhighlighting of commands whilst they are typed at a zsh prompt into an\ninteractive terminal. This helps in reviewing commands before running\nthem, particularly in catching syntax errors.\n\nSome examples:\n\nBefore: [](images/before1.png)\n\u003cbr/\u003e\nAfter:\u0026nbsp; [](images/after1.png)\n\nBefore: [](images/before2.png)\n\u003cbr/\u003e\nAfter:\u0026nbsp; [](images/after2.png)\n\nBefore: [](images/before3.png)\n\u003cbr/\u003e\nAfter:\u0026nbsp; [](images/after3.png)\n\nBefore: [](images/before4-smaller.png)\n\u003cbr/\u003e\nAfter:\u0026nbsp; [](images/after4-smaller.png)\n\n\n\nHow to install\n--------------\n\nSee [INSTALL.md](INSTALL.md).\n\n\nFAQ\n---\n\n### Why must `zsh-syntax-highlighting.zsh` be sourced at the end of the `.zshrc` file?\n\nzsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) and\ncomputing syntax highlighting for the command-line buffer as it stands at the\ntime z-sy-h\u0027s hook is invoked.\n\nIn zsh 5.2 and older,\n`zsh-syntax-highlighting.zsh` hooks into ZLE by wrapping ZLE widgets. It must\nbe sourced after all custom widgets have been created (i.e., after all `zle -N`\ncalls and after running `compinit`) in order to be able to wrap all of them.\nWidgets created after z-sy-h is sourced will work, but will not update the\nsyntax highlighting.\n\nIn zsh newer than 5.8 (not including 5.8 itself),\nzsh-syntax-highlighting uses the `add-zle",
"github_repo": "zsh-users/zsh-syntax-highlighting",
"github_stars": 22753,
"github_topics": [
"screenshot",
"shell",
"syntax-highlighting",
"zsh",
"zsh-syntax-highlighting"
],
"homepage": "https://github.com/zsh-users/zsh-syntax-highlighting",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 5062,
"installs_365d": 65515,
"installs_90d": 18195,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "BSD-3-Clause",
"llm_generated_at": "2026-06-20T23:45:50+00:00",
"llm_model": "claude-haiku-4-5",
"name": "zsh-syntax-highlighting",
"oldnames": [],
"one_liner": "Fish shell-like syntax highlighting for Zsh that color-codes commands as you type.",
"optional_dependencies": [],
"rank_30d": 594,
"rank_365d": 564,
"rank_90d": 560,
"raw_hash": "a75ef42a1aac3d60",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/z/zsh-syntax-highlighting.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [
{
"zsh": [
"build",
"test"
]
}
],
"version_head": "HEAD",
"version_stable": "0.8.0",
"versioned_formulae": [],
"why_use_this": "Instantly spot syntax errors and invalid commands before pressing Enter. Works by hooking into Zsh\u0027s line editor to highlight valid commands, options, and paths in different colors. Essential quality-of-life plugin for interactive Zsh users; must be sourced last in .zshrc."
}