Zsh Syntax Highlight
Across the wide set of features,zsh
has a nice package I never activated before, even if I was aware of its existance: zsh-syntax-highlighting
. The package is inspired by fish shell and is available here.
This package provides a highlight as you type functionality, so that commands that are mispelled (or not available to you) are shown in red, well written commands and arguments are in green, directories are underlined, and so on. Installing the package is a matter of seconds, e.g., on OpenBSD:
% doas pkg_add zsh-syntax-highlighting-0.7.1
Then you need to load the plugin **as a last thing in your
.zshrc
:
% tail -n 1 ~/.zshrc
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Please make sure the sourced file is in the right place, usually it is on
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
, but some package managers could install it on another place.
The following is a bare example of the plugin in action (please note that the colored prompt comes from the
adam1
theme).