Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable zsh 5.0 highlighting and colouring of the command line?

Tags:

zsh

ZSH 5.0 support highlighting and colouring of the command line, but how to enable it? I search with google, but no answer.

like image 931
ratazzi Avatar asked Feb 19 '23 17:02

ratazzi


2 Answers

This message is a little old, but I wanted to let you know I had a post with a similar question. One answer came back that there's a plugin zsh-syntax-highlighting that will allow you to do this. Hope that helps.

like image 106
TTT Avatar answered Apr 07 '23 00:04

TTT


By default, zsh highlights the whole regular command text with one colour and sets different colours for non-regular texts: incremental search match, region being marked, special characters and automatically removed suffixes. This all is controlled by zle_highlight variable, more data can be seen in Character Highlighting section in man zshzle. Additionally region_highlight variable can be used to highlight arbitrary region on the command-line, it is described in USER-DEFINED WIDGETS section in the same manual. To make the last one useful you need to find a zsh plugin or write out your own.

like image 30
ZyX Avatar answered Apr 07 '23 00:04

ZyX