This project started from the zsh-syntax-highlighting, redesigned it completely added many new features and lifted up to the next level.
The aim of this project now is to provide unified colorful zsh environment.
That includes:
- completion system
- commands, functions, aliases, etc.
- possible commands arguments or options (like directory stack for
cd
or process ids forkill
)
- syntax
- including blocks of complex commands
- including files according to their attributes
- searched patterns in history
- selected regions
- default color scheme for some commands output (like
less
orgrep
)
All colors are coherent among different context, so that i.e. file.txt is presented always in the color regardless whether its the output of ls file.txt
, suggestion from completion system or written by hand directly on the command line (see below for examples).
The program check the terminal capability and uses 256 (if possible) or 8 color palette. All color are configurable.
-
Download the script or clone this repository:
git clone git:https://github.com/jimmijj/chromatic-zsh.git
-
Add full path of the script at the end of
~/.zshrc
:echo '. /path/to/chromatic-zsh/chromatic-zsh.zsh' >>~/.zshrc
-
Start new session with
zsh
.
Some features for completion system works only if it is enable. Thus, although not strictly neccessary, I recommend to add also to ~/.zshrc:
autoload -U compinit && compinit
zstyle ':completion:*' verbose yes
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select
-
The basic
ls
output with--color
option (on GNU system) uses$LS_COLORS
environment variable to attach color to each file type. The result may look like that: -
One expects that the same color is used in completion system
(note: at the end of the line
tab
was hit) -
and also syntax highlighting on the command line:
-
Options and their descriptions are highlighted differently:
(again notice tab after
-
) -
Here is the sample of some longer command line...
-
and completion with many categories:
Notice the same color for the same group (reserved words, parameters, etc) on the command line and completion system with the example above.
-
Directories are in blue everywhere, also in the directory stack completion of
cd -
. -
Process ids are red by default, clearly separated from pseudoterminal numbers
-
Searched pattern looks the same regardless where search took place: shell history or grep command