To add Syntax Highlighting in Zsh Shell, follow the below steps,
- Open the Terminal on your Mac/Linux.
- Make sure you have brew installed.
% brew --version Homebrew 4.0.19 - Now you will need to install package zsh-syntax-highlighting using HomeBrew.
% brew install zsh-syntax-highlighting - Make sure to edit the .zshrc file and add the following.
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - Run the below command to activate syntax highlighting.
% source ~/.zshrc
Now when you will try to run commands with options on your Zsh shell you will see the text getting syntax highlighted (blue and red).

If you face any problems in these steps, do let me know in the comments, I will try to assist.
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!