HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
zsh-users
zsh-syntax-highlighting
Shell2012–2025
zsh-users / zsh-syntax-highlighting

zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.

29Distinct people
33Mentions
0Explicit recommenders
23.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Fish shell like syntax highlighting for Zsh.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year33 dated mentions

Observed mentions: 2012-06-06 12:14:55 UTC to 2025-07-20 20:54:34 UTC.

024682012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC707
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC202
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC404
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC514
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC817
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC303
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 12, 2026.

Read the project’s introduction
zsh-syntax-highlighting Fish shell-like syntax highlighting for Zsh. Requirements: zsh 4.3.11+. This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors. Some examples: Before: After:  Before: After:  Before: After:  Before: After:  How to install See INSTALL.md. FAQ Why must zsh-syntax-highlighting.zsh be sourced at the end of the .zshrc file? zsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) and computing syntax highlighting for the command-line buffer as it stands at the time z-sy-h's hook is invoked. In zsh 5.2 and older, zsh-syntax-highlighting.zsh hooks into ZLE by wrapping ZLE widgets. It must be sourced after all custom widgets have been created (i.e., after all zle -N calls and after running compinit) in order to be able to wrap all of them. Widgets created after z-sy-h is sourced will work, but will not update the syntax highlighting. In zsh newer than 5.8 (not including 5.8 itself), zsh-syntax-highlighting uses the add-zle-hook-widget facility to install a zle-line-pre-redraw hook. Hooks are run in order of registration, therefore, z-sy-h must be sourced (and register its hook) after anything else that adds hooks that modify the command-line buffer. Does syntax highlighting work during incremental history search? Highlighting the command line during an incremental history search (by default bound to to Ctrl+R in zsh's emacs keymap) requires zsh 5.4 or newer. Under zsh versions older than 5.4, the zsh-default underlining of the matched portion of the buffer remains available, but zsh-syntax-highlighting's additional highlighting is unavailable. (Those versions of zsh do not provide enough information to allow computing the highlighting correctly.) See issues #288 and #415 for details. How are new releases announced? There is currently no "push" announcements channel. However, the following alternatives exist: GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom An anitya entry: https://release-monitoring.org/project/7552/ How to tweak Syntax highlighting is done by pluggable highlighter scripts. See the documentation on highlighters for details and configuration settings.
Read the full README on GitHub

What Hacker News says

33 sources
Once you have everything figured out, you just keep using the config you have. It might be worth the investment. I stopped using oh-my-zsh when I realized it was what was causing multi-second delays on Raspberry Pis. I think auto suggestions and syntax highlighting plugins can be installed separately from oh-my-zsh. I use starship for a better prompt, and it works on more shells than just Zsh. I also have Atuin installed to share history across machines, and as a benefit the history search is a lot more powerful. https://github.com/zsh-users/zsh-autosuggestions https://github.com/zsh-users/zsh-syntax-highlighting https://starship.rs https://atuin.sh
In Speeding up my ZSH shell
I'm also in this boat. I have atuin as part of my zsh config that is distributed to all new machines, whether they run NixOS or some other operating system with Nix on them (e.g. MacOS). After switching to NixOS I found an interest in maintaining a custom setup again, since it wouldn't fall apart every time I moved machine. { pkgs, ... }: { users.defaultUserShell = pkgs.zsh; environment.systemPackages = with pkgs; [ atuin # ^R eza # ls git zsh ]; programs.direnv.enable = true; programs.nix-direnv.enable = true; programs.zsh = { enable = true; enableCompletion = true; enableBashCompletion = true; enableGlobalCompInit = true; # https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md syntaxHighlighting.enable = true;
Read the rest
syntaxHighlighting.highlighters = [ "main" "brackets" ]; # See `man zshoptions` for more details. setOptions = [ # Remove duplicates continuously from command history (preserve newest entry). "HIST_IGNORE_DUPS" # Instantly share command history between all active shells. "SHARE_HISTORY" # Alternative to: "APPEND_HISTORY", "INC_APPEND_HISTORY", # Disable ^S and ^Z for less accidental freezing. "FLOW_CONTROL" # Save timestamp and duration of each command in command history. "EXTENDED_HISTORY" ]; shellAliases = { # Navigation rm = "rm -iv"; ls = "eza -lg"; tree = "eza -lgT"; # git aliases # ... }; promptInit = '' autoload -U promptinit promptinit prompt off # Simple: # PS1='[%n@%m:%~] %(!.#.$) ' # Colorful: # PS1='[%F{green}%n@%m%f:%F{blue}%~%f] %(!.#.$) ' # Colorful with git branch: function git_branch_name() { branch=$(git symbolic-ref HEAD --short 2>/dev/null) if [ ! -z "$branch" ]; then echo -n " [%F{red}$branch%f]" fi } # Omit username, print hostname + '$' with red when root, otherwise green: prompt='[%(!.%F{red}.%F{green})%m%f:%F{blue}%~%f]$(git_branch_name) %(!.%F{red}#%f.$) ' # See: https://zsh.sourceforge.io/Doc/Release/Options.html#Prompting setopt prompt_cr setopt prompt_sp setopt prompt_subst export PROMPT_EOL_MARK="" ''; interactiveShellInit = '' # Prevent user-level "config missing" message. touch $HOME/.zshrc # MacOS bindkey '^[[7~' beginning-of-line bindkey '^[[8~' end-of-line # Linux bindkey '^[[1;3D' beginning-of-line # alt+left bindkey '^[[1;3C' end-of-line # alt+right bindkey '^[[1;5D' backward-word # ctrl+left bindkey '^[[1;5C' forward-word # ctrl+right # Both bindkey '^R' history-incremental-search-backward bindkey '^U' kill-whole-line bindkey '^Y' yank # My SSH endpoints don't recognize modern terminals export TERM=xterm-256color # ^R only eval "$(atuin init zsh --disable-up-arrow)" ''; }; }
In Better Shell History Search
I switched to fish for about six months, and recently went back to zsh when I realised that the three things I really liked about it (abbreviations, syntax highlighting and autosuggestions) were all doable in zsh with extensions [0]. (It feels pretty slow, even slower than say OMZ, but that's not such a big deal for me.) [0] https://github.com/olets/zsh-abbr https://github.com/zsh-users/zsh-syntax-highlighting https://github.com/zsh-users/zsh-autosuggestions
In s/bash/zsh/g
> But zsh doesn't even use readline, which is bananas to me. Sure, provide an alternative but at least support readline. Why? ZLE is what makes zsh compelling for users. It provides a high level of customizability into command line editing that is simply not possible with bash. It powers zsh's most touted completion feature as well as popular plugins such as zsh-syntax-highlighting[1] and zsh-autosuggestions[2]. Replacing it with readline would be a sure way to lose a majority of users in a blink of an eye. [1]: https://github.com/zsh-users/zsh-syntax-highlighting [2]: https://github.com/zsh-users/zsh-autosuggestions
In s/bash/zsh/g

Remove background highlighting when pasting text into the terminal

The background highlighting when pasting text into into the terminal / shell has subtly annoyed me for a while. Here is how to remove it: zsh: Add `zle_highlight+=(paste:none)` to ~/.zshrc [1] bash (v4.4+): add `set enable-bracketed-paste off` to ~/.inputrc [2] [1] https://github.com/zsh-users/zsh-syntax-highlighting/issues/349 [2] https://www.garyshood.com/bash-highlight/
1 points · Open discussion
A lot of the tips from TFA can be done in BASH as well and I'm sure the following of my own zsh tips also have a bash equivelant, but I'd like to share anyway: Pure theme - My absolute favorite shell theme. Has almost all the bells and whistles of the powerlevel9k shown in the article, but looks, much cleaner and less in-your-face. After downloading the theme, I've added this to my `.zshrc` file: # PURE theme - see https://github.com/sindresorhus/pure fpath+=$HOME/.zsh/pure autoload -U promptinit; promptinit prompt pure Fuzzy find makes searching history much more powerful than what is listed in the article. I only use it together with ctr-r, but you can set it up for even more goodness. # Fuzzy find - see https://github.com/junegunn/fzf [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh Lastly I've added a syntax highl
Read the rest
ighter, which is really neat. # ZSH Syntax Highlighter - see https://github.com/zsh-users/zsh-syntax-highlighting source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh I don't use oh-my-zsh, but I think my terminal is as fully fledged as even the best oh-my-zsh can offer.
In Zsh Tricks to Blow Your Mind
I think fish is great for newcomers or for those who don't really want to mess around with too many settings or plugins. I'm a fish user, actually. That said, for those on zsh who want some of fish's most prominent user features without leaving, check out zsh-syntax-highlighting[1] and zsh-autosuggestions[2]. These are rather popular so long time users may not benefit from these suggestions. [1] https://github.com/zsh-users/zsh-syntax-highlighting [2] https://github.com/zsh-users/zsh-autosuggestions
In Bash 5.1
One of the biggest upgrades from using fish is syntax highlighting / autocompletion. You can get fish-style syntax highlighting and autocomplete in zsh (which has the advantage of being more interoperable with bash generally): [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) Poster mentioned "modern alternatives exist" with good colorization options. Some of my favorite colorized feature-rich alternatives: ls -> [exa](https://github.com/ogham/exa) cat -> [bat](https://github.com/sharkdp/bat) du -> [ncdu](https://dev.yorhel.nl/ncdu) diff -> [delta](https://github.com/dandavison/delta) In combination with all of the above, [fzf](https://github.com/junegunn/fzf) suddenly becomes a syntax-highlighter preview-pane via leveraging bat (or delta
Read the rest
, as the case may be).
In Colorize Your CLI

Showing the 15 most recent of 33 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.